summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 5d70ef8..451c014 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,7 +1,6 @@
#include "game.h"
#include "game/assets.h"
-// disable new_delete_type_mismatch asan warning
#ifndef __has_feature
#define __has_feature(feature) 0
#endif
@@ -16,7 +15,7 @@ I32* canvas;
GAME_DATA* game;
GL_DATA* gl;
-void loop() {
+U8 loop() {
static U8 init = 0;
if( !init || !gl ) {
@@ -27,10 +26,10 @@ void loop() {
game = game_init( gl );
init = 1;
- return;
+ return 0;
}
- game_main_loop( game );
+ return game_main_loop( game );
}
int main(int argc, char* argv[]) {
@@ -40,8 +39,8 @@ int main(int argc, char* argv[]) {
canvas[0] = 800;
canvas[1] = 600;
- while( true ) {
- loop();
+ for( ;; ) {
+ if( loop() ) break;
}
game_destroy( game );