SDL_HINT_JOYSTICK_HIDAPI(3)

πŸ’– SDL_HINT_JOYSTICK_HIDAPI πŸ’–

okay bestie, this is a page from the SDL3 functions manual, and it's literally just one little hint that decides a big vibe: are we letting the HIDAPI joystick drivers in or not. that's the whole thing. let's get into it πŸŽ€


✨ NAME ✨

SDL_HINT_JOYSTICK_HIDAPI β€” a variable controlling whether the HIDAPI joystick drivers should be used. that's it, that's the girl πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_hints.h>

#define SDL_HINT_JOYSTICK_HIDAPI "SDL_JOYSTICK_HIDAPI"

so you pull in the header, and the hint's actual string name is "SDL_JOYSTICK_HIDAPI". that's what you hand to the hint-setting functions. periodt 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

bestie, this variable is a switch and it only has two moods. here's the menu:

  • "0" β€” HIDAPI drivers are not used. nope, not today.
  • "1" β€” HIDAPI drivers are used. (this is the default, the factory setting, the main character ✨)

and here's the tea: this variable is the default for all drivers, but it can be <highkey>overridden</highkey> by the hints for specific drivers below. so like, it sets the group chat rules, but individual drivers can still mute themselves. iykyk πŸ’€

🚨 one thing you cannot skip: this hint should be set before initializing joysticks and gamepads. set it after and it's giving too late, bestie, the drivers already picked their outfit. 😭

⭐ AVAILABILITY ⭐

this hint is available since SDL 3.2.0. if you're on anything older, it's not here, no cap. πŸ’œ


πŸŽ€ sign-off πŸŽ€

that's the whole page, bestie! this gem lives in the Simple Directmedia Layer manual, SDL 3.4.18 edition, and you read the SDL_HINT_JOYSTICK_HIDAPI(3) page. go forth and set your hints early, you icon πŸ‘‘πŸ’–βœ¨

πŸ“¦ where this page comes from