SDL_GetGamepadVendorForID(3)
๐ SDL_GetGamepadVendorForID ๐
okay bestie, so this one lives in the SDL3 FUNCTIONS family and it's literally the glow-up you call when you wanna know who made this gamepad โ specifically its USB vendor ID. no cap.
โจ NAME โจ
SDL_GetGamepadVendorForID โ get the USB vendor ID of a gamepad, if it's available ๐ฎ
๐ธ SYNOPSIS ๐ธ
#include <SDL3/SDL_gamepad.h>
Uint16 SDL_GetGamepadVendorForID(SDL_JoystickID instance_id);
๐ฆ DESCRIPTION ๐ฆ
the tea is: you can call this before any gamepads are even opened. like, no setup era required, she's ready whenever you are ๐
but if the vendor ID just isn't available? she returns 0. that's it, that's the vibe.
๐ FUNCTION PARAMETERS ๐
instance_idโ the joystick instance ID. that's the little number that tells her which gamepad you're asking about, bestie.
โญ RETURN VALUE โญ
she hands you back the USB vendor ID of the selected gamepad ๐ซถ
and if you call her on an invalid index? zero. 0. nothing. so if you get a 0, that's your sign something's off, not me being dramatic ๐ญ
๐ THREAD SAFETY ๐
it is safe to call this function from any thread. periodt. go off, multithreaded queen ๐
๐ AVAILABILITY ๐
this function is available since SDL 3.2.0 โจ so if you're on something older, that's a no from her.
๐ฅ SEE ALSO ๐ฅ
okay that's the whole page, mwah ๐ this one's brought to you by Simple Directmedia Layer, version SDL 3.4.18 โ go get that vendor ID, bestie, ily ๐ง๐
๐ฆ 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