Module main
Available on crate feature
dep_sdl3
only.Expand description
Redefine main() if necessary so that it is called by SDL.
In order to make this consistent on all platforms, the application’s main() should look like this:
int main(int argc, char *argv[])
{
}
SDL will take care of platform specific details on how it gets called.
This is also where an app can be configured to use the main callbacks, via the SDL_MAIN_USE_CALLBACKS macro.
This is a “single-header library,” which is to say that including this header inserts code into your program, and you should only include it once in most cases. SDL.h does not include this header automatically.
For more information, see:
Functions§
- SDL_
AppEvent ⚠ - App-implemented event entry point for SDL_MAIN_USE_CALLBACKS apps.
- SDL_
AppInit ⚠ - App-implemented initial entry point for SDL_MAIN_USE_CALLBACKS apps.
- SDL_
AppIterate ⚠ - App-implemented iteration entry point for SDL_MAIN_USE_CALLBACKS apps.
- SDL_
AppQuit ⚠ - App-implemented deinit entry point for SDL_MAIN_USE_CALLBACKS apps.
- SDL_
Enter ⚠AppMain Callbacks - An entry point for SDL’s use in SDL_MAIN_USE_CALLBACKS.
- SDL_
GDKSuspend ⚠Complete - Callback from the application to let the suspend continue.
- 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.
- SDL_
SetMain ⚠Ready - Circumvent failure of
SDL_Init()
when not usingSDL_main()
as an entry point. - SDL_
main ⚠ - An app-supplied function for program entry.
Type Aliases§
- SDL_
main_ func - The prototype for the application’s main() function