SDL_AppResult(3type)
π SDL_AppResult π
okay bestie, this is SDL_AppResult from the SDL3 DATATYPES corner of the SDL3 manual, and honestly? it's giving "tiny enum, huge main character energy". sit down, hydrate, let's go. π«Ά
β¨ NAME β¨
SDL_AppResult β the return values for those optional main callbacks. yeah. the lil vibe-check your app gives back to SDL. π
πΈ SYNOPSIS πΈ
#include <SDL3/SDL_init.h>
typedef enum SDL_AppResult
{
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;
literally just three little guys. three options. a whole trilogy. π
π¦ DESCRIPTION π¦
so here's the tea. if you return SDL_APP_SUCCESS or SDL_APP_FAILURE from SDL_AppInit, SDL_AppEvent, or SDL_AppIterate, the program terminates and reports success/failure to the operating system. slay, but also: what that means is platform-dependent. no cap.
on Unix, for example, on success the process error code will be zero, and on failure it will be 1. that's it. that's the range.
π¨ important: this interface does not let you return specific exit codes. it's just "was there an error generally or not". binary. yes or no. that's the whole menu. don't come in here asking for42orEXIT_FAILURE-with-feelings, because she can't do it. π
and if you return SDL_APP_CONTINUE from these functions? the app just keeps running. keep going. keep thriving. the show does not stop. π₯
for the complete details, go read Main callbacks in SDL3 over here:
https://wiki.libsdl.org/SDL3/README-main-functions#main-callbacks-in-sdl3
iykyk. π
β AVAILABILITY β
this enum has been available since SDL 3.2.0. so if you're on something olderβ¦ bestie, upgrade. π
and that's the whole page!! no notes, ate, periodt. π β¨
this icon of a datatype comes to you from the Simple Directmedia Layer girlies, version SDL 3.4.18, filed under SDL_AppResult(3type). go forth and return your little enum values with confidence. mwah. πππ¦πΈ
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms