SDL_GetHapticNameForID(3)

πŸ’– SDL_GetHapticNameForID πŸ’–

okay bestie, so this one lives in the SDL3 FUNCTIONS section of the manual, and it's literally just you asking a haptic device "hey girl, what's your name?" before you've even said hi to it. no cap. πŸŽ€


✨ NAME ✨

SDL_GetHapticNameForID β€” get the implementation dependent name of a haptic device. that's it, that's the whole vibe. πŸ¦‹


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_haptic.h>

const char * SDL_GetHapticNameForID(SDL_HapticID instance_id);

πŸ’… DESCRIPTION πŸ’…

the way this is so convenient: you can call this before any haptic devices are opened. like, you don't have to open a single thing first. it's giving window shopping. πŸ‘‘


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • instance_id β€” the haptic device instance ID. that's the lil number/handle that tells you which haptic device you're talking to, so you're not out here asking the wrong one for its name. πŸ’€

⭐ RETURN VALUE ⭐

it returns the name of the selected haptic device. yay. 🫢

but if no name can be found, this function returns NULL. and when that happens? call SDL_GetError() for more information, bestie. don't just sit there staring at a null pointer, go get the tea. 😭

⚠️ fr fr, always check for NULL before you go printing that thing. the void does not have a name.

🌈 AVAILABILITY 🌈

this function is available since SDL 3.2.0. if you're on something older, no name for you, sorry babe. πŸ’œ


πŸ”₯ SEE ALSO πŸ”₯


Simple Directmedia Layer 🧚 SDL 3.4.18 πŸŽ€ SDL_GetHapticNameForID(3) β€” mwah, ily, go name some haptics. πŸ’–βœ¨

πŸ“¦ where this page comes from