SDL_GetJoystickGUIDInfo(3)
β¨ SDL_GetJoystickGUIDInfo β¨
okay bestie, so this is a page from the SDL3 FUNCTIONS manual (that's the SDL_GetJoystickGUIDInfo(3) one, in case the header didn't tip you off π ) and we're about to decode a whole controller's identity from one little struct. no cap.
π NAME π
SDL_GetJoystickGUIDInfo</purl> β get the device information encoded in a SDL_GUID structure. it's giving detective work but make it β¨siliconβ¨
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_joystick.h>
void SDL_GetJoystickGUIDInfo(SDL_GUID guid, Uint16 *vendor, Uint16 *product, Uint16 *version, Uint16 *crc16);
π FUNCTION PARAMETERS π
guidβ theSDL_GUIDyou wish to get info about. your main character. the one we're interrogating π΅οΈβοΈvendorβ a pointer filled in with the device VID, or0if not available.productβ a pointer filled in with the device PID, or0if not available.versionβ a pointer filled in with the device version, or0if not available.crc16β a pointer filled in with a CRC used to distinguish different products with the same VID/PID, or0if not available. yes bestie, sometimes two devices share a VID and a PID and this is the lil tiebreaker π₯
π¦ THREAD SAFETY π¦
It is safe to call this function from any thread. go off, thread it, spawn a thousand of them, she does not care π β¨
π AVAILABILITY π
This function is available since SDL 3.2.0. vintage-ish but iconic π
π SEE ALSO π
SDL_GetJoystickGUIDForID(3)β the reverse-direction bestie, go check her out π«Ά
and that's the whole page, no crumbs left πΈ thanks for reading, mwah π
this lil slice of docs came to you courtesy of Simple Directmedia Layer β SDL 3.4.18, periodt. take care of her, she's doing the lord's work ππβ¨
π¦ 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