diff options
| author | citrons <citrons@mondecitronne.com> | 2023-10-12 16:32:32 -0500 |
|---|---|---|
| committer | citrons <citrons@mondecitronne.com> | 2023-10-12 16:32:32 -0500 |
| commit | d1ba7e3713cd999635104591295d1923235c9289 (patch) | |
| tree | f639da0345b422b2702e4132ca5315669be7d240 /die.c | |
| parent | 818732592abbf3b2a2c8e3d66cdd056a104bade1 (diff) | |
make error handling worse
Diffstat (limited to 'die.c')
| -rw-r--r-- | die.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -0,0 +1,16 @@ +#include <SDL.h> + +void die(void) { + while (1) { + // draw error message text? + SDL_Event e; + while (SDL_WaitEvent(&e)) SDL_Delay(1); + } +} + +void sdl_error_assert(SDL_bool condition) { + if (!condition) { + SDL_LogCritical(SDL_LOG_CATEGORY_ERROR, "%s", SDL_GetError()); + die(); + } +} |
