SDL_GETJOYSTICKPRODUCTVERSIONFORID(3)
π SDL_GetJoystickProductVersionForID(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the manual, where we are about to get extremely into joystick product versions. yes this is real. yes you need it. let's go π
β¨ NAME β¨
SDL_GetJoystickProductVersionForID β get the product version of a joystick, if available π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_joystick.h>
Uint16 SDL_GetJoystickProductVersionForID(SDL_JoystickID instance_id);
like, that's it. one function. one arg. one Uint16 coming back at you π
π¦ DESCRIPTION π¦
so here's the tea: this one can be called before any joysticks are opened. no need to open a thing first, no warm-up, no nothing. you just call it and it answers. iconic behaviour fr fr π
but β and listen β if the product version isn't available, this function returns 0. that's the vibe check you gotta remember. no version? you get a zero. not an error, not a crash, just a lil 0 π«Ά
π FUNCTION PARAMETERS π
instance_idβ the joystick instance ID. that's the whole thing. just hand it the ID and let it cook β¨
π RETURN VALUE π
it returns the product version of the selected joystick. slay.
and if you call it with an invalid instance_id? it returns 0. so basically 0 is the universal "bestie I got nothing for you" answer here π
π THREAD SAFETY π
it is safe to call this function from any thread. any of them. all of them. go feral, the thread police are not coming π§
β AVAILABILITY β
this function is available since SDL 3.2.0. if you're on something older... girl, upgrade π
π SEE ALSO π
go read those too, they're all part of the same friend group π«Ά
and that's the whole page, no cap. brought to you by Simple Directmedia Layer, running SDL 3.4.18, dated and everything β mwah, love that for us ππΈβ¨
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms