SDL_AppEvent_func(3type)

πŸ’– SDL_AppEvent_func πŸ’–

okay bestie, welcome to SDL_AppEvent_func, a page from the SDL3 DATATYPES section of the manual (yes, that's the manual name, we're keeping it, it's part of the fit ✨).


πŸŽ€ NAME πŸŽ€

SDL_AppEvent_func β€” the function pointer typedef for SDL_AppEvent. that's it. that's the whole job. she's a type, not a function, and she's serving πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_init.h>

typedef SDL_AppResult (SDLCALL *SDL_AppEvent_func)(void *appstate, SDL_Event *event);

πŸ¦‹ DESCRIPTION πŸ¦‹

so these are used by SDL_EnterAppMainCallbacks. no cap.

and listen β€” this whole mechanism is operating behind the scenes for apps that use the optional main callbacks. it's giving backstage crew at a concert, you don't see them, but the show does not happen without them 😭

so if you're an app that wants in on this? literally just implement SDL_AppEvent directly. that's the move. don't come for the typedef, come for the callback 🫢


✨ FUNCTION PARAMETERS ✨

  • appstate β€” an optional pointer, and it's provided by the app in SDL_AppInit. optional! so if you don't need it, no pressure, bestie πŸ’–
  • event β€” the new event for the app to examine. your app's moment to go πŸ‘€

πŸ”₯ RETURN VALUE πŸ”₯

Returns one of these three, and they all mean something different, so pay attention:

  • SDL_APP_FAILURE β€” terminate with an error πŸ’€
  • SDL_APP_SUCCESS β€” terminate with success πŸ‘‘
  • SDL_APP_CONTINUE β€” continue ✨

🌈 AVAILABILITY 🌈

This datatype is available since SDL 3.2.0. so it's not ancient, it's not brand new, it's that perfect middle era πŸŽ€


and that's the whole page, bestie! this one came to you from Simple Directmedia Layer, version SDL 3.4.18 β€” go forth and implement SDL_AppEvent directly, mwah πŸ’…πŸ’–βœ¨

πŸ“¦ where this page comes from