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