src/window.c

changeset 105
2b7f92ff2c15
parent 101
febf3dc10011
child 106
895f92cff6b8
--- a/src/window.c	Sat May 03 13:30:04 2025 +0200
+++ b/src/window.c	Sat May 03 13:49:24 2025 +0200
@@ -69,18 +69,17 @@
     }
 
     window->id = SDL_GetWindowID(window->window);
-    SDL_GetWindowSize(window->window,
-            &window->dimensions.width,
-            &window->dimensions.height
-    );
+    {
+        Sint32 w, h;
+        SDL_GetWindowSize(window->window, &w, &h);
+        window->dimensions = asc_vec2u_new(w, h);
+    }
     window->resized = true; // count initial sizing as resize
 
     if (asc_gl_context_initialize(&window->glctx, window->window, &settings->glsettings)) {
         asc_scene_init(&window->ui, (AscCameraParams){
             .type = ASC_CAMERA_ORTHO,
-            .ortho.rect = (asc_recti){
-                0, 0, window->dimensions.width, window->dimensions.height
-            },
+            .ortho.rect = asc_recti_new(0, 0, window->dimensions.width, window->dimensions.height),
             .projection_update_func = asc_camera_ortho_update_size
         });
         asc_dprintf("Window %u initialized at index %u", window->id, index);

mercurial