test/snake.c

changeset 63
e3cacdd636e4
parent 62
5a592625e2f9
child 65
9c44c55d327a
--- a/test/snake.c	Tue Apr 16 22:06:17 2024 +0200
+++ b/test/snake.c	Tue Apr 16 22:20:17 2024 +0200
@@ -100,7 +100,12 @@
             SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR,
                     "Fatal Error", asc_get_error(), window->window);
             asc_clear_error();
-            break;
+            asc_context_quit();
+        }
+
+        // quit application on ESC key press
+        if (asc_key_pressed(ESCAPE)) {
+            asc_context_quit();
         }
     } while (asc_loop_next());
 

mercurial