SDL_AssertState(3type)
π SDL_AssertState β NAME β¨
okay bestie, so this is SDL_AssertState(3type), straight out of the SDL3 DATATYPES manual, and it's literally just the menu of possible outcomes you get when an assertion goes off. like, an assert fires and everybody's like "okayβ¦ what now??" and this enum is the answer key. π
πΈ SYNOPSIS πΈ
pull it in with:
#include <SDL3/SDL_assert.h>
and here's the whole thing, verbatim, no notes:
typedef enum SDL_AssertState
{
SDL_ASSERTION_RETRY, /**< Retry the assert immediately. */
SDL_ASSERTION_BREAK, /**< Make the debugger trigger a breakpoint. */
SDL_ASSERTION_ABORT, /**< Terminate the program. */
SDL_ASSERTION_IGNORE, /**< Ignore the assert. */
SDL_ASSERTION_ALWAYS_IGNORE /**< Ignore the assert from now on. */
} SDL_AssertState;
and the vibe check on each one, one by one, no skipping:
SDL_ASSERTION_RETRYβ run that assert back immediately, like "wait, do it again, I wasn't looking" πSDL_ASSERTION_BREAKβ make the debugger hit a breakpoint. pause the whole thing, we're investigating πSDL_ASSERTION_ABORTβ terminate the program. it's over, bestie, lights out πSDL_ASSERTION_IGNOREβ ignore the assert. we're pretending we didn't see that πSDL_ASSERTION_ALWAYS_IGNOREβ ignore the assert from now on. not just this once, forever, it's giving "I'm choosing peace" β¨
π¦ DESCRIPTION π¦
so when an enabled assertion triggers, it may call the assertion handler β possibly one your app handed over via SDL_SetAssertionHandler β and that handler returns one of these values, possibly after asking the user first. so yeah, sometimes a human is literally in the loop deciding your fate. π
then SDL responds based on whatever came back: loop around to retry the condition, try to break in a debugger, kill the program, or ignore the problem. that's the whole plot. no cap. π₯
π AVAILABILITY π
this enum is available since SDL 3.2.0. she's not ancient, she's just iconic. π
lowkey remember: whatever the handler returns actually decides whether your program lives, dies, or just keeps looping. main character energy for real. π
and that's the page, bestie! this came to you from Simple Directmedia Layer, version SDL 3.4.18 β mwah, go forth and assert responsibly π«ΆπΈβ¨
π¦ 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