summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/main.cc b/src/main.cc
index 406b900..842c174 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -2,12 +2,12 @@
// It serves as the application entry point.
// Orchestrates platform initialization, main loop, and subsystem coordination.
+#include "3d/renderer.h"
#include "audio/audio.h"
#include "audio/gen.h"
#include "audio/synth.h"
#include "generated/assets.h" // Include generated asset header
#include "gpu/gpu.h"
-#include "3d/renderer.h"
#include "platform.h"
#include "util/math.h"
#include <GLFW/glfw3.h>
@@ -238,9 +238,19 @@ int main(int argc, char** argv) {
// Start real audio
audio_start();
+ int last_width = platform_state.width;
+ int last_height = platform_state.height;
+
while (!platform_should_close(&platform_state)) {
platform_poll(&platform_state);
+ if (platform_state.width != last_width ||
+ platform_state.height != last_height) {
+ last_width = platform_state.width;
+ last_height = platform_state.height;
+ gpu_resize(last_width, last_height);
+ }
+
double current_time = platform_get_time() + seek_time; // Offset logic time
update_game_logic(current_time);