SDL_GamepadHasSensor(3)

✨ NAME ✨

SDL_GamepadHasSensor β€” return whether a gamepad has a particular sensor. Like, bestie, we're checking if your controller has that sensor situation going on. πŸŽ€

Okay so, this page lives in the SDL3 FUNCTIONS manual, and it's literally here to answer one tiny but iconic question: does this gamepad have this sensor? Yes or no. That's the whole plot. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <SDL3/SDL_gamepad.h>

bool SDL_GamepadHasSensor(SDL_Gamepad *gamepad, SDL_SensorType type);

🌸 FUNCTION PARAMETERS 🌸

  • gamepad β€” the gamepad to query. The one you're side-eyeing and asking, "do you have it or not?" 🫢
  • type β€” the type of sensor to query. Like, which sensor are we checking for? πŸ‘€

πŸ’– RETURN VALUE πŸ’–

Returns true if the sensor exists, false otherwise. Simple. Clean. No cap. ✨


🧚 THREAD SAFETY 🧚

It is safe to call this function from any thread. So yes, you can call it from any thread, bestie. Thread-safe and unbothered. πŸ‘‘


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0. Periodt. πŸ’œ


🌈 SEE ALSO 🌈


Simple Directmedia Layer β€’ SDL 3.4.18 β€” that's the footer energy, bestie. No date printed on this one, just pure SDL3 FUNCTIONS realness. Stay slay. πŸ’–πŸ¦‹

πŸ“¦ where this page comes from