SDL_GUID(3type)
β¨ SDL_GUID β the 128-bit glow-up β¨
okay so bestie, welcome to the SDL3 DATATYPES corner of the manual, page SDL_GUID(3type). this one's short but it's iconic, trust. π
πΈ NAME πΈ
SDL_GUID β an SDL_GUID is a 128-bit identifier for an input device that identifies that device across runs of SDL programs on the same platform. fr fr, it's the device's little permanent name tag. π
π¦ SYNOPSIS π¦
#include <SDL3/SDL_guid.h>
typedef struct SDL_GUID {
Uint8 data[16];
} SDL_GUID;
look at her. sixteen lil bytes. Uint8 data[16] and that's the whole entire struct. no cap. π
π DESCRIPTION π
so here's the vibe. if the device gets detached and then re-attached to a different port, or if the base system gets rebooted, the device should still report the same GUID. like, she remembers who she is. main character energy, honestly. π
GUIDs are as precise as possible, but β and this is the important part, don't skip it β they are not guaranteed to distinguish physically distinct but equivalent devices. for example, two game controllers from the same vendor with the same product ID and revision may have the same GUID. so yeah, twins can absolutely have the same ID. π
also GUIDs may be platform-dependent β meaning the same device may report different GUIDs on different operating systems. so don't go carrying that value across platforms and expecting it to still hit, bestie. π«Ά
π AVAILABILITY π
this struct has been available since SDL 3.2.0. so if you're on something older... girl. π
that's the whole page, you ate it up. π
Simple Directmedia Layer β’ SDL 3.4.18 β’ page SDL_GUID(3type) β mwah, ily, go write some device-matching code, bestie πβ¨π¦
π¦ 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