From 3a409326be68add729324fa878905ba57e5f5513 Mon Sep 17 00:00:00 2001 From: CobaltXII Date: Sun, 30 Dec 2018 21:03:31 -0500 Subject: [PATCH] Added window resize functionality --- src/main.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 898ca8a..243aaed 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -38,7 +38,7 @@ int main(int argc, char** argv) sdl_x_res, sdl_y_res, - SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_OPENGL + SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_OPENGL ); // Make sure the SDL_Window* was created successfully. @@ -216,6 +216,10 @@ int main(int argc, char** argv) auto frame_start_time = std::chrono::high_resolution_clock::now(); + // Get the size of the sdl_window*, in case it was resized. + + SDL_GetWindowSize(sdl_window, &sdl_x_res, &sdl_y_res); + // Poll events. SDL_Event e;