SDL_GetJoystickType(3)

๐Ÿ’– SDL_GetJoystickType(3) ๐Ÿ’–

okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we answer the question you've been lowkey dying to ask: what KIND of joystick is this?? ๐ŸŽฎโœจ


โœจ NAME โœจ

SDL_GetJoystickType โ€” get the type of an opened joystick.

like. it's already open. it's already in your hands. and now we're gonna find out what it actually is. main character energy fr. ๐Ÿ‘‘


๐ŸŒธ SYNOPSIS ๐ŸŒธ

#include <SDL3/SDL_joystick.h>

SDL_JoystickType SDL_GetJoystickType(SDL_Joystick *joystick);

there it is. one function. one job. no cap. ๐Ÿ’…


๐ŸŽ€ FUNCTION PARAMETERS ๐ŸŽ€

  • joystick โ€” the SDL_Joystick you got from SDL_OpenJoystick(). yeah, that one. the one you already opened. this function is not out here opening anything for you, it's just here to look. ๐Ÿ‘€

๐Ÿฆ‹ RETURN VALUE ๐Ÿฆ‹

it hands you back the SDL_JoystickType of the joystick you selected. that's it. that's the whole gift. ๐ŸŽ


๐Ÿ’œ THREAD SAFETY ๐Ÿ’œ

you can call this from any thread. literally any of them. it's giving unbothered, it's giving safe, it's giving "call me whenever, bestie". no locks, no drama, no stress. ๐Ÿซถ


โญ AVAILABILITY โญ

this little icon has been around since SDL 3.2.0. so if you're on anything olderโ€ฆ babe, why. ๐Ÿ˜ญ


๐ŸŒˆ SEE ALSO ๐ŸŒˆ


ok but fr fr, don't forget: this one needs an already-opened SDL_Joystick. if you haven't opened it yet, this function is gonna have nothing to say to you. ๐Ÿ™ˆ

and that's the whole page, bestie!! brought to you by Simple Directmedia Layer ๐Ÿ’– SDL 3.4.18 โ€” go check your joystick type, you iconic legend, and slay the rest of your day. periodt. ๐ŸŽ€โœจ๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from