SDL_SetMainReady(3)
okay so bestie, this is SDL_SetMainReady(3), and yes it's from the SDL3 FUNCTIONS manual π no cap. It's the page that saves your SDL_Init() from doing a dramatic flop when your entry point isn't SDL_main(). Let's get into it β¨
π NAME π
SDL_SetMainReady β the function that circumvents failure of SDL_Init() when you're not using SDL_main() as an entry point. slay π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_main.h>
void SDL_SetMainReady(void);
π¦ DESCRIPTION π¦
so here's the lore: this function is defined in SDL_main.h, along with the preprocessor rule that redefines main() as SDL_main() π.
That means if you want your own main() function to not get changed, you have to define SDL_MAIN_HANDLED before including SDL.h. literally define it first, bestie, before the include, or the preprocessor will do its little switcheroo π
.
π THREAD SAFETY π
not thread safe. do not come at this one from multiple threads, bestie β it is not giving thread-safe energy. periodt π
π AVAILABILITY π
- available since SDL 3.2.0 β¨
π SEE ALSO π
SDL_Init(3)β go read that one too, it's the whole reason this function exists π«Ά
mwah π this page came from Simple Directmedia Layer, version SDL 3.4.18 β and the footer didn't give a date, so no date to spill. SDL_SetMainReady(3) out πππ¦
π¦ 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