shithub: duke3d

Download patch

ref: f47d9afa937f72c286cabfffbd0b212a3f40893e
parent: d20b0f81f7c8324974629c7182322c03a4979ce4
author: Tanguy Fautre <tanguy@fautre.com>
date: Mon Feb 10 16:55:02 EST 2020

Fixed multiple window creation when changing resolution.

--- a/Engine/src/display.c
+++ b/Engine/src/display.c
@@ -186,6 +186,12 @@
 
 static void go_to_new_vid_mode(int w, int h)
 {
+    if (window != NULL)
+    {
+        SDL_FreeSurface(surface);
+        SDL_DestroyWindow(window);
+    }
+	
     window = SDL_CreateWindow(
         titleName,
         SDL_WINDOWPOS_CENTERED,