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 β€” the SDL_GUID you wish to get info about. your main character. the one we're interrogating πŸ•΅οΈβ™€οΈ
  • vendor β€” a pointer filled in with the device VID, or 0 if not available.
  • product β€” a pointer filled in with the device PID, or 0 if not available.
  • version β€” a pointer filled in with the device version, or 0 if not available.
  • crc16 β€” a pointer filled in with a CRC used to distinguish different products with the same VID/PID, or 0 if 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 πŸ’œ


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