SDL_EnterAppMainCallbacks(3)
π SDL_EnterAppMainCallbacks(3) π
okay bestie, welcome to the SDL3 FUNCTIONS corner of the man pages, this one's called SDL_EnterAppMainCallbacks and it's lowkey a secret backstage door. let's get into it π
β¨ NAME β¨
SDL_EnterAppMainCallbacks β the entry point that SDL uses when you're rolling with SDL_MAIN_USE_CALLBACKS. it's giving "backstage pass" energy π«Ά
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_main.h>
int SDL_EnterAppMainCallbacks(int argc, char *argv[], SDL_AppInit_func appinit, SDL_AppIterate_func appiter, SDL_AppEvent_func appevent, SDL_AppQuit_func appquit);
look at all those callback params, it's literally a whole friend group π§
π DESCRIPTION π
okay so generally you should NOT call this function directly. like, fr fr. this thing only exists so SDL can hand off work into itself ASAP β that way SDL has so much more control and functionality available to it, and the inline code in SDL_main.h stays as smol and cute as possible β¨
and btw, not every platform even uses this. its actual use is hidden inside a magic header-only library πͺ (yes, magic, we said what we said). so you should not call this directly unless you _really_ know what you're doing. emphasis on really, bestie, we're being so serious π
π calling this when you don't 100% know what you're doing is not the vibe. it's not a "just try it and see" situation. iykyk.
π¦ FUNCTION PARAMETERS π¦
argcβ standard Unix mainargc. the classic. the icon. the number-of-args situation πargvβ standard Unix mainargv. the actual args themselves, slaying in array form πappinitβ the application'sSDL_AppInitfunction. your little init moment π±appiterβ the application'sSDL_AppIteratefunction. the loop girlie, doing her rounds on repeat πappeventβ the application'sSDL_AppEventfunction. catching every event like it's gossip πappquitβ the application'sSDL_AppQuitfunction. the graceful goodbye, no dramatic exits π
β RETURN VALUE β
returns the standard Unix main return value. nothing fancy, just the classic int, doing its thing π
π THREAD SAFETY π
π¨ it is not safe to call this anywhere except as the only function call in SDL_main. only. one. call. no friends allowed. periodt.
π AVAILABILITY π
this function is available since SDL 3.2.0 β¨ (so if you're on an older SDL, she's not there yet, be patient bestie π¦)
and that's the whole page!! mwah π this came to you from the fine people at Simple Directmedia Layer, SDL 3.4.18, and yeah it's SDL_EnterAppMainCallbacks(3) β go forth and do NOT call it directly unless you're built different π
π
π¦ 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