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 inSDL_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
- 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