SDL_HapticEffectSupported(3)

✨ SDL_HapticEffectSupported ✨

okay so bestie, this one lives in the SDL3 FUNCTIONS squad and it's literally the vibe-check function for haptic effects πŸ’…

🌸 NAME 🌸

SDL_HapticEffectSupported β€” check to see if an effect is supported by a haptic device πŸŽ€

Like, before you go spending all your main character energy building a whole custom rumble effect, you ask the device first. No cap. It's giving "does this even work here, or are we wasting our time" πŸ¦‹


🫢 SYNOPSIS 🫢

#include <SDL3/SDL_haptic.h>

bool SDL_HapticEffectSupported(SDL_Haptic *haptic, const SDL_HapticEffect *effect);

πŸ’– FUNCTION PARAMETERS πŸ’–

  • haptic β€” the SDL_Haptic device to query 🌈 like, the one you're asking. The source of truth. The oracle, if you will.
  • effect β€” the desired effect to query πŸ’« the actual effect you're wondering about. Drop it in, get your answer.

⭐ RETURN VALUE ⭐

Returns true if the effect is supported, or false if it isn't 😭

That's it. That's the whole thing. Binary. Iconic. No ambiguous maybe-energy, just yes or no, periodt πŸ‘‘

πŸ”₯ AVAILABILITY πŸ”₯

This function is available since SDL 3.2.0 ✨ so if you're on anything older, bestie, you're out of luck πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘


so yeah, that's the whole page β€” go forth and query your haptics, you gorgeous nerd 🧚

this lil' slice of documentation came courtesy of Simple Directmedia Layer β€” SDL 3.4.18, dated right alongside SDL_HapticEffectSupported(3) πŸ’œ stay slay, stay haptic-aware πŸŽ€

πŸ“¦ where this page comes from