SDL_GetJoystickTypeForID(3)

๐Ÿ’– SDL_GetJoystickTypeForID ๐Ÿ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, this one is literally called SDL_GetJoystickTypeForID and it's giving "who is this joystick and what IS she" energy โœจ


๐ŸŒธ NAME ๐ŸŒธ

SDL_GetJoystickTypeForID โ€” get the type of a joystick, if available. no cap, that's the whole job ๐ŸŽฎ


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

#include <SDL3/SDL_joystick.h>

SDL_JoystickType SDL_GetJoystickTypeForID(SDL_JoystickID instance_id);

๐Ÿ’… DESCRIPTION ๐Ÿ’…

the tea is: you can call this before any joysticks are opened. like, before. zero setup, zero open, just vibes and an ID. it's giving main character energy because it doesn't need the whole joystick subsystem awake first ๐Ÿซถ


๐ŸŽ€ FUNCTION PARAMETERS ๐ŸŽ€

  • instance_id โ€” the joystick instance ID. that's it, that's the whole parameter, she's lowkey simple ๐Ÿ’œ

โญ RETURN VALUE โญ

returns the SDL_JoystickType of the selected joystick. iconic. correct. slay.

but bestie, if you hand her an invalid instance_id, she doesn't guess, she doesn't improvise โ€” she returns SDL_JOYSTICK_TYPE_UNKNOWN. so if you get that back, double check your ID, fr fr ๐Ÿ˜ญ

๐Ÿงš THREAD SAFETY ๐Ÿงš

it is safe to call this function from any thread. any thread. all the threads. go wild, she can handle it ๐Ÿ”ฅ


๐ŸŒˆ AVAILABILITY ๐ŸŒˆ

this function is available since SDL 3.2.0. if you're on something older, sorry bestie, she wasn't born yet ๐Ÿ™ˆ


๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘


and that's the whole page, periodt ๐Ÿ’…

Simple Directmedia Layer โ€” SDL 3.4.18 โ€” SDL_GetJoystickTypeForID(3) ๐Ÿฆ‹๐Ÿ’– go check the type of that joystick, you absolute icon โœจ

๐Ÿ“ฆ where this page comes from