SDL_HINT_JOYSTICK_HIDAPI_LUNA(3)

πŸ’– SDL_HINT_JOYSTICK_HIDAPI_LUNA πŸ’–

okay bestie, so this is a hint from the SDL3 hint collection (that's the SDL3 manual, function pages section, if you're keeping track) and it's literally just one little switch that decides whether Amazon Luna controllers chilling over Bluetooth get to use the HIDAPI driver. that's the whole vibe. let's get into it πŸŽ€


✨ SYNOPSIS ✨

#include <SDL3/SDL_hints.h>

#define SDL_HINT_JOYSTICK_HIDAPI_LUNA "SDL_JOYSTICK_HIDAPI_LUNA"

so you pull in SDL3/SDL_hints.h and the hint's actual string name is SDL_JOYSTICK_HIDAPI_LUNA. the macro is just that string, no cap. 🫢


🌸 DESCRIPTION 🌸

this variable is a yes/no situation and it takes these values:

  • "0" β€” the HIDAPI driver is not used. nope. not today.
  • "1" β€” the HIDAPI driver is used. slay, we're doing it.

the default? it's literally the value of SDL_HINT_JOYSTICK_HIDAPI. so if you never set this one, it just inherits whatever that one says. the way that it just quietly follows the parent hint... iconic honestly. πŸ’…

⚠️ real talk though: this hint should be set before you initialize joysticks and gamepads. set it after and it's giving too late bestie, the driver decisions already happened. πŸ’€

🌈 AVAILABILITY 🌈

this hint has been available since SDL 3.2.0. so if you're on something older, it's not there and no amount of manifestation will summon it πŸ™ˆ


and that's the whole page!! go forth and Luna-ify your Bluetooth controllers πŸ’œ

Simple Directmedia Layer made this, and this particular page is from SDL 3.4.18 β€” the page itself is SDL_HINT_JOYSTICK_HIDAPI_LUNA(3), in case you need to cite it or whatever. mwah, bye!! πŸ¦‹βœ¨

πŸ“¦ where this page comes from