include: Clean up SDL_AppResult documentation.

This commit is contained in:
Ryan C. Gordon 2024-08-17 00:37:56 -04:00
parent abdd8b4929
commit 4c30e555fe
No known key found for this signature in database
GPG Key ID: FA148B892AB48044
1 changed files with 11 additions and 3 deletions

View File

@ -73,13 +73,21 @@ typedef Uint32 SDL_InitFlags;
* https://wiki.libsdl.org/SDL3/README/main-functions#main-callbacks-in-sdl3
* for details.
*
* Returning SDL_APP_SUCCESS or SDL_APP_FAILURE from SDL_AppInit, SDL_AppEvent, or SDL_AppIterate
* will terminate the program and report success/failure to the operating system. What that means
* is platform-dependent. On Unix, for example, on success, the process error code will be zero,
* and on failure it will be 1. This interface doesn't allow you to return specific exit codes,
* just whether there was an error generally or not.
*
* Returning SDL_APP_CONTINUE from these functions will let the app continue to run.
*
* \since This enum is available since SDL 3.0.0.
*/
typedef enum SDL_AppResult
{
SDL_APP_CONTINUE, /** Value that requests that the app continue from the main callbacks. If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the program will continue to run. */
SDL_APP_SUCCESS, /** Value that requests termination with success from the main callbacks. If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the program will terminate and report success to the operating system. What that success looks like is platform-dependent. On Unix, for example, the process error code will be zero. */
SDL_APP_FAILURE /** Value that requests termination with error from the main callbacks. If SDL_AppInit, SDL_AppEvent, or SDL_AppIterate returns this value, the program will terminate and report failure to the operating system. What that failure looks like is platform-dependent. On Unix, for example, the process error code will be non-zero. */
SDL_APP_CONTINUE, /** Value that requests that the app continue from the main callbacks. */
SDL_APP_SUCCESS, /** Value that requests termination with success from the main callbacks. */
SDL_APP_FAILURE /** Value that requests termination with error from the main callbacks. */
} SDL_AppResult;
typedef SDL_AppResult (SDLCALL *SDL_AppInit_func)(void **appstate, int argc, char *argv[]);