SDL_AppQuit_func(3type)

πŸ’– SDL_AppQuit_func πŸ’–

okay bestie, welcome to the SDL3 DATATYPES corner of the manual, where we're talking about SDL_AppQuit_func β€” yes it's a mouthful, yes it's iconic, and yes you're gonna understand it in like thirty seconds. 🫢


✨ NAME ✨

SDL_AppQuit_func β€” the function pointer typedef for SDL_AppQuit. literally what it says on the tin, no notes. πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_init.h>

typedef void (SDLCALL *SDL_AppQuit_func)(void *appstate, SDL_AppResult result);

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea, bestie: these are used by SDL_EnterAppMainCallbacks. β˜•

This whole mechanism operates behind the scenes for apps that are using the optional main callbacks. So it's giving backstage-pass energy β€” you don't have to touch it directly. Apps that actually wanna use this should just implement SDL_AppEvent directly. that's it, that's the move. ✨


πŸŽ€ FUNCTION PARAMETERS πŸŽ€

  • appstate β€” an optional pointer, and it's provided by the app over in SDL_AppInit. your little backpack of state, if you want one. πŸŽ’
  • result β€” the result code that terminated the app (success or failure). so basically the receipts of how it all ended. πŸ‘‘

⭐ AVAILABILITY ⭐

This datatype is available since SDL 3.2.0. so if you're on anything older, it's not you, it's the version. 😭


ngl this one is short and sweet β€” a typedef, two params, and a whole lot of behind-the-scenes magic. periodt. πŸ’œ

and that's the whole page, bestie!! brought to you by Simple Directmedia Layer, version SDL 3.4.18 β€” mwah, go slay your app's quit handling, iykyk πŸ§šπŸ’–πŸŒˆ

πŸ“¦ where this page comes from