include: Filled in all remaining missing documentation!

This commit is contained in:
Ryan C. Gordon
2024-12-22 01:57:07 -05:00
parent 4d8f5758cf
commit f0fad41f2c
17 changed files with 1874 additions and 142 deletions

View File

@@ -28,9 +28,9 @@
* should look like this:
*
* ```c
* int main(int argc, char *argv[])
* {
* }
* int main(int argc, char *argv[])
* {
* }
* ```
*
* SDL will take care of platform specific details on how it gets called.
@@ -55,6 +55,84 @@
#include <SDL3/SDL_error.h>
#include <SDL3/SDL_events.h>
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* Inform SDL that the app is providing an entry point instead of SDL.
*
* SDL does not define this macro, but will check if it is defined when
* including `SDL_main.h`. If defined, SDL will expect the app to provide the
* proper entry point for the platform, and all the other magic details
* needed, like manually calling SDL_SetMainReady.
*
* Please see [README/main-functions](README/main-functions), (or
* docs/README-main-functions.md in the source tree) for a more detailed
* explanation.
*
* \since This macro is used by the headers since SDL 3.1.3.
*/
#define SDL_MAIN_HANDLED 1
/**
* Inform SDL to use the main callbacks instead of main.
*
* SDL does not define this macro, but will check if it is defined when
* including `SDL_main.h`. If defined, SDL will expect the app to provide
* several functions: SDL_AppInit, SDL_AppEvent, SDL_AppIterate, and
* SDL_AppQuit. The app should not provide a `main` function in this case, and
* doing so will likely cause the build to fail.
*
* Please see [README/main-functions](README/main-functions), (or
* docs/README-main-functions.md in the source tree) for a more detailed
* explanation.
*
* \since This macro is used by the headers since SDL 3.1.3.
*
* \sa SDL_AppInit
* \sa SDL_AppEvent
* \sa SDL_AppIterate
* \sa SDL_AppQuit
*/
#define SDL_MAIN_USE_CALLBACKS 1
/**
* Defined if the target platform offers a special mainline through SDL.
*
* This won't be defined otherwise. If defined, SDL's headers will redefine
* `main` to `SDL_main`.
*
* This macro is defined by `SDL_main.h`, which is not automatically included
* by `SDL.h`.
*
* Even if available, an app can define SDL_MAIN_HANDLED and provide their
* own, if they know what they're doing.
*
* This macro is used internally by SDL, and apps probably shouldn't rely on it.
*
* \since This macro is available since SDL 3.1.3.
*/
#define SDL_MAIN_AVAILABLE
/**
* Defined if the target platform _requires_ a special mainline through SDL.
*
* This won't be defined otherwise. If defined, SDL's headers will redefine
* `main` to `SDL_main`.
*
* This macro is defined by `SDL_main.h`, which is not automatically included
* by `SDL.h`.
*
* Even if required, an app can define SDL_MAIN_HANDLED and provide their
* own, if they know what they're doing.
*
* This macro is used internally by SDL, and apps probably shouldn't rely on it.
*
* \since This macro is available since SDL 3.1.3.
*/
#define SDL_MAIN_NEEDED
#endif
#ifndef SDL_MAIN_HANDLED
#if defined(SDL_PLATFORM_PRIVATE_MAIN)
/* Private platforms may have their own ideas about entry points. */
@@ -144,7 +222,26 @@
#endif
#endif /* SDL_MAIN_HANDLED */
#ifdef SDL_MAIN_EXPORTED
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* A macro to tag a main entry point function as exported.
*
* Most platforms don't need this, and the macro will be defined to nothing.
* Some, like Android, keep the entry points in a shared library and need to
* explicitly export the symbols.
*
* External code rarely needs this, and if it needs something, it's almost
* always SDL_DECLSPEC instead.
*
* \since This macro is available since SDL 3.1.3.
*
* \sa SDL_DECLSPEC
*/
#define SDLMAIN_DECLSPEC
#elif defined(SDL_MAIN_EXPORTED)
/* We need to export SDL_main so it can be launched from external code,
like SDLActivity.java on Android */
#define SDLMAIN_DECLSPEC SDL_DECLSPEC
@@ -153,31 +250,6 @@
#define SDLMAIN_DECLSPEC
#endif /* SDL_MAIN_EXPORTED */
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
/**
* Inform SDL to use the main callbacks instead of main.
*
* SDL does not define this macro, but will check if it is defined when
* including `SDL_main.h`. If defined, SDL will expect the app to provide
* several functions: SDL_AppInit, SDL_AppEvent, SDL_AppIterate, and
* SDL_AppQuit. The app should not provide a `main` function in this case, and
* doing so will likely cause the build to fail.
*
* Please see [README/main-functions](README/main-functions), (or
* docs/README-main-functions.md in the source tree) for a more detailed
* explanation.
*
* \since This macro is used by the headers since SDL 3.1.3.
*
* \sa SDL_AppInit
* \sa SDL_AppEvent
* \sa SDL_AppIterate
* \sa SDL_AppQuit
*/
#define SDL_MAIN_USE_CALLBACKS 1
#endif
#if defined(SDL_MAIN_NEEDED) || defined(SDL_MAIN_AVAILABLE) || defined(SDL_MAIN_USE_CALLBACKS)
#define main SDL_main
#endif