src/window.c

changeset 262
b47de42f4598
parent 257
67d7b79997df
--- a/src/window.c	Sat Aug 09 14:36:39 2025 +0200
+++ b/src/window.c	Tue Aug 12 21:04:59 2025 +0200
@@ -143,6 +143,16 @@
     glViewport(0, 0, window_width, window_height);
     glClear(GL_COLOR_BUFFER_BIT);
 
+    // Update the viewports when the window resized
+    if (window->resized) {
+        for (unsigned int i = 0; i < ASC_MAX_SCENES; i++) {
+            if (asc_scene_active(&window->scenes[i])) {
+                asc_camera_update_viewport(&window->scenes[i].camera, window->dimensions);
+            }
+        }
+        asc_camera_update_viewport(&window->ui.camera, window->dimensions);
+    }
+
     // Execute all behaviors
     // TODO: this can eventually be parallelized
     for (unsigned int i = 0; i < ASC_MAX_SCENES; i++) {

mercurial