SDL_GetJoystickFromID(3)

πŸ’– NAME πŸ’–

SDL_GetJoystickFromID β€” bestie, this is the lil' function that hands you back the SDL_Joystick that's tied to a specific instance ID, but ONLY if that joystick has already been opened. Not opened yet? She's not gonna dig it out of the void for you. πŸ™ˆ


✨ SYNOPSIS ✨

#include <SDL3/SDL_joystick.h>

SDL_Joystick * SDL_GetJoystickFromID(SDL_JoystickID instance_id);

πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • instance_id β€” the instance ID you want the SDL_Joystick for. That's it, that's the whole vibe check. πŸ¦‹

🌸 RETURN VALUE 🌸

On success you get an SDL_Joystick back. πŸ’… On failure β€” OR if that joystick just hasn't been opened yet β€” you get NULL. And when you get that NULL, do the responsible thing and call SDL_GetError() for more information, because she will absolutely tell you what went wrong. πŸ”₯


🌈 THREAD SAFETY 🌈

It is safe to call this function from any thread. Go off, multithreaded queen. πŸ‘‘


⭐ AVAILABILITY ⭐

This function is available since SDL 3.2.0. If you're on anything older, sorry bestie, no cap, it's not there. πŸ’€


okay that's the whole page, periodt 🫢 thanks for reading, this was brought to you by Simple Directmedia Layer, running SDL 3.4.18 β€” mwah, catch you in the next manpage, love u, bye!! πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from