SDL_GetJoystickVendorForID(3)
๐ SDL_GetJoystickVendorForID ๐
okay bestie, welcome to the SDL_GetJoystickVendorForID page from the SDL3 functions manual, and honestly? it's giving "tiny function, huge usefulness" โจ
๐ธ NAME ๐ธ
SDL_GetJoystickVendorForID โ bestie, this one snags you the USB vendor ID of a joystick, if it's available. no cap. ๐ฎ
โจ SYNOPSIS โจ
#include <SDL3/SDL_joystick.h>
Uint16 SDL_GetJoystickVendorForID(SDL_JoystickID instance_id);
๐ฆ DESCRIPTION ๐ฆ
okay so here's the tea ๐ต โ you can call this before any joysticks are opened. like, you don't have to crack anything open first, she's ready whenever.
and if the vendor ID isn't available? the function just hands you back 0. that's it. no drama, no crash, just a lil zero. ๐
๐ FUNCTION PARAMETERS ๐
instance_idโ the joystick instance ID. like the lil name tag your controller wears at the party ๐ซถ
๐ RETURN VALUE ๐
she returns the USB vendor ID of the selected joystick. obsessed. ๐ฅ
but heads up: if you call her with an invalid instance_id, you get 0 back. every time. so if you're getting a zero, do a lil vibe check on your ID, bestie. ๐
๐ง THREAD SAFETY ๐ง
it is safe to call this function from any thread. any of them. all of them. go wild, she's built different. โจ
๐ AVAILABILITY ๐
this function has been available since SDL 3.2.0. so if you're on 3.2.0 or later, you're so valid. ๐
๐ SEE ALSO ๐
go read those too, they're iconic in their own right. iykyk ๐
ngl if you skipped straight to the bottom, the whole thing is: pass an instance ID, get aUint16vendor ID, or0if it's not there or the ID's bogus. periodt. ๐
kisses and take care of yourself, bestie โ this page came straight from the Simple Directmedia Layer crew, SDL 3.4.18 edition, and it's yours to love forever ๐๐ฆ๐
๐ฆ 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