src/window.c

changeset 12
d89e0ebc76d2
parent 9
6ad1a4213954
child 13
f04a49b2aeee
     1.1 --- a/src/window.c	Tue Nov 07 21:24:06 2023 +0100
     1.2 +++ b/src/window.c	Wed Nov 08 21:46:29 2023 +0100
     1.3 @@ -57,6 +57,7 @@
     1.4          if (asc_context.windows[i].id == id) {
     1.5              asc_context.windows[i].dimensions.width = width;
     1.6              asc_context.windows[i].dimensions.height = height;
     1.7 +            asc_mat4f_ortho(asc_context.windows[i].projection, 0, (float) width, (float) height, 0);
     1.8              return;
     1.9          }
    1.10      }
    1.11 @@ -144,6 +145,13 @@
    1.12              &window->dimensions.width,
    1.13              &window->dimensions.height
    1.14      );
    1.15 +    asc_mat4f_ortho(
    1.16 +            window->projection,
    1.17 +            0,
    1.18 +            (float) window->dimensions.width,
    1.19 +            (float) window->dimensions.height,
    1.20 +            0
    1.21 +    );
    1.22  
    1.23      SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
    1.24      SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, settings->gl_major_version);

mercurial