Back to shtanton's homepage
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorostanton <oliver@stanton.uk.net>2025-04-05 12:59:42 +0100
committerostanton <oliver@stanton.uk.net>2025-04-05 12:59:42 +0100
commit72580b4f254402647f9420ed07c5d67a9fe75187 (patch)
treeb63f2fea4547e8934afc44c88f8914104e8da9cd
parentb851d1dee56a191b3eabee957af4bb35f0a3e2cb (diff)
downloadldjam57-grid.tar
Resize grid to fit windowgrid
-rw-r--r--src/all.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/all.c b/src/all.c
index 4fe3d5b..b98c8f6 100644
--- a/src/all.c
+++ b/src/all.c
@@ -129,7 +129,7 @@ int main(int argc, char **argv) {
"LDJam 57",
game->ui.width,
game->ui.height,
- 0
+ SDL_WINDOW_RESIZABLE
);
SDL_PropertiesID renderProps = SDL_CreateProperties();
SDL_SetPointerProperty(renderProps, SDL_PROP_RENDERER_CREATE_WINDOW_POINTER, w);
@@ -149,6 +149,9 @@ int main(int argc, char **argv) {
game->mousex = (int) e.button.x;
game->mousey = (int) e.button.y;
break;
+ case SDL_EVENT_WINDOW_RESIZED:
+ SDL_GetWindowSize(w, &game->ui.width, &game->ui.height);
+ break;
}
}