SDL_QuitEvent(3)

πŸ¦‹ SDL_QuitEvent(3) β€” SDL API Reference πŸ¦‹

ok bestie, this is a page from the SDL API Reference, and it's about the little struct that shows up when someone wants to close your app. it's tiny. it's iconic. let's go πŸ’…


✨ NAME ✨

SDL_QuitEvent β€” Quit requested event πŸšͺ


πŸŽ€ STRUCTURE DEFINITION πŸŽ€

no cap, this is the whole entire thing:

typedef struct{
  Uint8 type
} SDL_QuitEvent;

that's it. that's the struct. she's minimal πŸ’€


🌸 STRUCTURE DATA 🌸

  • type β€” SDL_QUIT

literally one field. one. she said "I contain multitudes" and then contained one Uint8. queen behavior πŸ‘‘


πŸ’– DESCRIPTION πŸ’–

so SDL_QuitEvent is a member of the SDL_Event union, and it's what you get when an event of type SDL_QUIT is reported. that's her whole job 🫢

and yeah, as you can literally see up there, the SDL_QuitEvent structure itself serves no useful purpose. it's giving decorative. the event, though? highkey very important, bestie. pay attention:

  • if you filter out a quit event, or just ignore it β€” it becomes impossible for the user to close the window 😭 like, they're trapped. not slay.
  • but if you do accept a quit event, then the application window will be closed β€” and heads up, screen updates will still report success even though the application will no longer be visible. yes fr fr, updates be lying to you like that πŸ™ˆ
Note: ✨ the macro SDL_QuitRequested will return non-zero if a quit event is pending πŸ‘€ so you can vibe check it before it arrives.

πŸ‘€ SEE ALSO πŸ‘€

  • SDL_Event
  • SDL_SetEventFilter

and that's the whole page, bestie β€” no more notes, no extra lore 🧚

πŸ’œ this was SDL_QuitEvent(3) from the SDL API Reference, brought to you by SDL, dated Tue 11 Sep 2001, 22:59 β€” yes, a vintage. an antique. a classic. periodt πŸŽ€βœ¨

πŸ“¦ where this page comes from