summaryrefslogtreecommitdiff
path: root/die.c
diff options
context:
space:
mode:
Diffstat (limited to 'die.c')
-rw-r--r--die.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/die.c b/die.c
new file mode 100644
index 0000000..95ca7c2
--- /dev/null
+++ b/die.c
@@ -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();
+ }
+}