SDL_HINT_AUTO_UPDATE_SENSORS(3)

πŸ’– SDL_HINT_AUTO_UPDATE_SENSORS πŸ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where today's main character is SDL_HINT_AUTO_UPDATE_SENSORS β€” a hint that decides whether SDL is out here updating your sensor state while it's grabbing input events, or whether you are doing that yourself. no cap. ✨


✨ NAME ✨

SDL_HINT_AUTO_UPDATE_SENSORS β€” a variable that controls whether SDL updates sensor state when getting input events. that's it, that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hints.h>

#define SDL_HINT_AUTO_UPDATE_SENSORS "SDL_AUTO_UPDATE_SENSORS"

literally just include the header and you've got the macro, periodt. πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

so the way this works is you set the variable to one of these two values, and the universe (well, SDL) responds accordingly:

  • "0" β€” you'll call SDL_UpdateSensors() manually. that's you being the main character and handling it yourself, we respect it. πŸ‘‘
  • "1" β€” SDL will automatically call SDL_UpdateSensors(). this one is the default, so if you don't say anything, SDL just handles it for you. iconic behaviour honestly. πŸ”₯

also! this hint can be set anytime. no waiting around, no "only before init" nonsense. set it whenever your heart desires. πŸ’–


🌈 AVAILABILITY 🌈

this hint is available since SDL 3.2.0. so if you're on anything older, bestie, it's giving ✨ nothing ✨ β€” you gotta upgrade. πŸ™ˆ


and that's the whole page, bestie!! you ate that. πŸ’…βœ¨

kisses and sensor updates, from the Simple Directmedia Layer girlies β€” this is SDL 3.4.18, SDL_HINT_AUTO_UPDATE_SENSORS(3), signing off πŸ«ΆπŸŒΈπŸŽ€

πŸ“¦ where this page comes from