summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authoraura <nw@moneybot.cc>2026-03-10 01:35:50 +0100
committeraura <nw@moneybot.cc>2026-03-10 01:35:50 +0100
commit8329d42d3e592f4cd42cdfa586e2325ddc76c898 (patch)
treedec7e2a733bfc6b6384936c1f3ed067a42b59bb9 /src/main.cpp
parent8ae8c85e9d3806cdb726e07f37e1b49484c5c48e (diff)
perf profiler, simplify 2d render, string struct, many small things
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 );