changed resizing window instead of recreating it on window size changes
authorHolger Schemel <info@artsoft.org>
Wed, 7 Sep 2022 19:06:37 +0000 (21:06 +0200)
committerHolger Schemel <info@artsoft.org>
Wed, 7 Sep 2022 19:21:07 +0000 (21:21 +0200)
This has the advantage that the window stays at its screen position
instead of always being newly created in the middle of the screen.

src/libgame/sdl.c

index fe859452a07fc7fed8d6ca2b47b3114d735a628a..094b656511e88ae2614a4503345fbe610e46951a 100644 (file)
@@ -589,8 +589,7 @@ static boolean SDLCreateScreen(boolean fullscreen)
 
     if (sdl_window)
     {
-      SDL_DestroyWindow(sdl_window);
-      sdl_window = NULL;
+      SDL_SetWindowSize(sdl_window, video.window_width, video.window_height);
     }
   }