SDL_QuitEvent(3type)

πŸ’– SDL_QuitEvent πŸ’–

okay bestie, welcome to the SDL3 DATATYPES corner of the manual, where we're talking about SDL_QuitEvent β€” literally the "quit requested" event. that's the whole vibe. someone (or something) wants out, and this lil struct is how the library tells you 🫢


✨ NAME ✨

SDL_QuitEvent β€” the "quit requested" event πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_events.h>

typedef struct SDL_QuitEvent
{
    SDL_EventType type; /**< SDL_EVENT_QUIT */
    Uint32 reserved;
    Uint64 timestamp;   /**< In nanoseconds, populated using SDL_GetTicksNS() */
} SDL_QuitEvent;

so here's the breakdown, no cap:

  • type β€” it's an SDL_EventType, and for this one it's always gonna be SDL_EVENT_QUIT. iconic, consistent, we love that for it πŸ’–
  • reserved β€” it's a Uint32 and honestly it's just sitting there being reserved. don't touch it, it's not for you πŸ™ˆ
  • timestamp β€” a Uint64, measured in nanoseconds, and it gets populated using SDL_GetTicksNS(). so you know exactly when the quit energy arrived ⭐
heads up bestie: keep those field names and types exactly as written, fr fr. the struct is doing its job, don't come for it.

πŸ¦‹ AVAILABILITY πŸ¦‹

this struct has been available since SDL 3.2.0. she's new-ish but she's thriving πŸ‘‘


that's the whole page, babe β€” short, sweet, and every field accounted for. the way this struct is just three members and zero drama? main character energy, periodt πŸ’…

Simple Directmedia Layer wrote this one, it's from the SDL 3.4.18 era, and it lives at SDL_QuitEvent(3type). go forth and handle your quit events responsibly πŸŽ€βœ¨πŸ’œ

πŸ“¦ where this page comes from