SDL_DisplayEvent(3type)
π SDL_DisplayEvent π
okay bestie, welcome to the SDL_DisplayEvent page from the SDL3 DATATYPES era of the manual β it's giving "your screen just did a thing and we need to tell you about it" and honestly? iconic. β¨
πΈ NAME πΈ
SDL_DisplayEvent β display state change event data, aka the whole event.display.* situation π₯οΈπ«
π SYNOPSIS π
first things first, you gotta pull in the header:
#include <SDL3/SDL_events.h>
then boom, here's the struct, copied exactly, no notes:
typedef struct SDL_DisplayEvent
{
SDL_EventType type; /**< SDL_EVENT_DISPLAY_* */
Uint32 reserved;
Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
SDL_DisplayID displayID;/**< The associated display */
Sint32 data1; /**< event dependent data */
Sint32 data2; /**< event dependent data */
} SDL_DisplayEvent;
π¦ the members, one by one π¦
typeβ anSDL_EventType, and it's always one of theSDL_EVENT_DISPLAY_*squad. this is your vibe check on which display thing happened. πreservedβ aUint32just... sitting there. reserved. mind your business, don't touch it, it's not for us. πtimestampβ aUint64, measured in nanoseconds, and it gets filled in usingSDL_GetTicksNS(). so like, when did this happen, down to the nanosecond, no cap. β±οΈdisplayIDβ anSDL_DisplayID, aka the associated display. the specific screen that's going through it. π₯οΈdata1β aSint32of event dependent data. whatever the event needs it to be, bestie. it depends. πdata2β also aSint32, also event dependent data. the sequel. the second half of the story. π
ngl,data1anddata2are event dependent, which is the polite way of saying "read the docs for the specificSDL_EVENT_DISPLAY_*you got, because these two change their whole personality based on context." don't assume, don't guess. π«Ά
β¨ AVAILABILITY β¨
this struct has been serving since SDL 3.2.0. it's available, it's here, it's ready for you. π
and that's the whole page, no filler, all facts preserved, we ate and left no crumbs. π
this page came to you straight from Simple Directmedia Layer β SDL 3.4.18 β SDL_DisplayEvent(3type). mwah, take care of your displays, 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