SDL_CommonEvent(3type)

okay so bestie, this is the SDL_CommonEvent(3type) page from the SDL3 DATATYPES manual, and it's literally the blueprint for every event in SDL3 πŸ’–βœ¨.


πŸŽ€ NAME πŸŽ€

SDL_CommonEvent β€” fields shared by every event πŸ¦‹

Like, every single event gets these fields. Periodt.


✨ SYNOPSIS ✨

       #include <SDL3/SDL_events.h>

       typedef struct SDL_CommonEvent
       {
           Uint32 type;        /**< Event type, shared with all events, Uint32 to cover user events which are not in the SDL_EventType enumeration */
           Uint32 reserved;
           Uint64 timestamp;   /**< In nanoseconds, populated using SDL_GetTicksNS() */
       } SDL_CommonEvent;

so like, the type field is a Uint32 β€” it's the event type, shared with all events. And it's Uint32 specifically to cover user events which are not in the SDL_EventType enumeration. iykyk 😌.

then there's reserved β€” it's just a Uint32 that's, like, reserved. No cap, it's literally named reserved. It's giving placeholder energy πŸ’….

and then timestamp β€” it's a Uint64, measured in nanoseconds, and it gets populated using SDL_GetTicksNS(). So you know exactly when the event happened, down to the nanosecond. iconic ✨.


πŸ’– AVAILABILITY πŸ’–

this struct is available since SDL 3.2.0 β€” so if you're on an older version, it's giving not yet, bestie 😭.


this page was served by Simple Directmedia Layer, version SDL 3.4.18, and it's literally called SDL_CommonEvent(3type) πŸ’…βœ¨. stay slay, bestie 🫢.

πŸ“¦ where this page comes from