From 72580b4f254402647f9420ed07c5d67a9fe75187 Mon Sep 17 00:00:00 2001 From: ostanton Date: Sat, 5 Apr 2025 12:59:42 +0100 Subject: Resize grid to fit window --- src/all.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/all.c') 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; } } -- cgit v1.2.3