src/window.c

changeset 12
d89e0ebc76d2
parent 9
6ad1a4213954
child 13
f04a49b2aeee
--- a/src/window.c	Tue Nov 07 21:24:06 2023 +0100
+++ b/src/window.c	Wed Nov 08 21:46:29 2023 +0100
@@ -57,6 +57,7 @@
         if (asc_context.windows[i].id == id) {
             asc_context.windows[i].dimensions.width = width;
             asc_context.windows[i].dimensions.height = height;
+            asc_mat4f_ortho(asc_context.windows[i].projection, 0, (float) width, (float) height, 0);
             return;
         }
     }
@@ -144,6 +145,13 @@
             &window->dimensions.width,
             &window->dimensions.height
     );
+    asc_mat4f_ortho(
+            window->projection,
+            0,
+            (float) window->dimensions.width,
+            (float) window->dimensions.height,
+            0
+    );
 
     SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
     SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, settings->gl_major_version);

mercurial