# CategoryMain

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:

```c
#include <SDL3/SDL.h>
#include <SDL3/SDL_main.h>

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](SDL_MAIN_USE_CALLBACKS) macro.

[SDL_main](SDL_main).h 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:

https://wiki.libsdl.org/SDL3/README-main-functions

<!-- END CATEGORY DOCUMENTATION -->

## Functions

<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
<!-- BEGIN CATEGORY LIST: CategoryMain, CategoryAPIFunction -->
- [SDL_AppEvent](SDL_AppEvent)
- [SDL_AppInit](SDL_AppInit)
- [SDL_AppIterate](SDL_AppIterate)
- [SDL_AppQuit](SDL_AppQuit)
- [SDL_EnterAppMainCallbacks](SDL_EnterAppMainCallbacks)
- [SDL_GDKSuspendComplete](SDL_GDKSuspendComplete)
- [SDL_main](SDL_main)
- [SDL_RegisterApp](SDL_RegisterApp)
- [SDL_RunApp](SDL_RunApp)
- [SDL_SetMainReady](SDL_SetMainReady)
- [SDL_UnregisterApp](SDL_UnregisterApp)
<!-- END CATEGORY LIST -->

## Datatypes

<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
<!-- BEGIN CATEGORY LIST: CategoryMain, CategoryAPIDatatype -->
- [SDL_main_func](SDL_main_func)
<!-- END CATEGORY LIST -->

## Structs

<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
<!-- BEGIN CATEGORY LIST: CategoryMain, CategoryAPIStruct -->
- (none.)
<!-- END CATEGORY LIST -->

## Enums

<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
<!-- BEGIN CATEGORY LIST: CategoryMain, CategoryAPIEnum -->
- (none.)
<!-- END CATEGORY LIST -->

## Macros

<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
<!-- BEGIN CATEGORY LIST: CategoryMain, CategoryAPIMacro -->
- [SDL_MAIN_AVAILABLE](SDL_MAIN_AVAILABLE)
- [SDL_MAIN_HANDLED](SDL_MAIN_HANDLED)
- [SDL_MAIN_NEEDED](SDL_MAIN_NEEDED)
- [SDL_MAIN_USE_CALLBACKS](SDL_MAIN_USE_CALLBACKS)
- [SDLMAIN_DECLSPEC](SDLMAIN_DECLSPEC)
<!-- END CATEGORY LIST -->


----
[CategoryAPICategory](CategoryAPICategory)


