From 4185ef5b11a719ff0fc6b7804212e0ef05b276e2 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 28 Oct 2025 09:50:24 -0700
Subject: [PATCH] Fixed recreating the window during resize on Windows
---
src/SDL12_compat.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index eea0f685c..bcec26858 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -6483,10 +6483,10 @@ SetVideoModeImpl(int width, int height, int bpp, Uint32 flags12)
* - window is already SDL_OPENGL.
* - window is not a fullscreen window.
*/
+ const Uint32 important_flags = ~(SDL12_PREALLOC | SDL12_ANYFORMAT);
const SDL_bool recreate_window = (
- ((VideoSurface12->flags & ~SDL12_ANYFORMAT) != (flags12 & ~SDL12_ANYFORMAT)) ||
+ ((VideoSurface12->flags & important_flags) != (flags12 & important_flags)) ||
(!VideoSurface12->format || (VideoSurface12->format->BitsPerPixel != bpp)) ||
- ((flags12 & SDL12_OPENGL) != SDL12_OPENGL) ||
((flags12 & SDL12_FULLSCREEN) == SDL12_FULLSCREEN)
) ? SDL_TRUE : SDL_FALSE;
#elif defined(__APPLE__)