Man page - sdl_runapp(3)
Packages contains this manual
Manual
SDL_RunApp
NAMEHEADER FILE
SYNOPSIS
DESCRIPTION
FUNCTION PARAMETERS
RETURN VALUE
THREAD SAFETY
AVAILABILITY
NAME
SDL_RunApp - Initializes and launches an SDL application, by doing platform-specific initialization before calling your mainFunction and cleanups after it returns, if that is needed for a specific platform, otherwise it just calls mainFunction.
HEADER FILE
Defined in SDL3/SDL_main.h
SYNOPSIS
#include "SDL3/SDL.h"
int SDL_RunApp(int argc, char *argv[], SDL_main_func mainFunction, void *reserved);
DESCRIPTION
You can use this
if you want to use your own main() implementation without
using
SDL_main
(like when using
SDL_MAIN_HANDLED ). When using this, you do not need
SDL_SetMainReady ().
FUNCTION PARAMETERS
|
argc |
the argc parameter from the applicationâs main() function, or 0 if the platformâs main-equivalent has no argc. |
||
|
argv |
the argv parameter from the applicationâs main() function, or NULL if the platformâs main-equivalent has no argv. |
mainFunction
your SDL appâs C-style main(). NOT the function youâre calling this from! Its name doesnât matter; it doesnât literally have to be main .
reserved
should be NULL (reserved for future use, will probably be platform-specific then).
RETURN VALUE
Returns the return value from mainFunction: 0 on success, otherwise failure; SDL_GetError () might have more information on the failure.
THREAD SAFETY
Generally this is called once, near startup, from the processâs initial thread.
AVAILABILITY
This function is available since SDL 3.2.0.