From 593c2735ce61d93b430e4ca9e3a43beabce5394d Mon Sep 17 00:00:00 2001 From: Pavel Penev Date: Wed, 11 Dec 2024 15:08:36 +0200 Subject: [PATCH] Revert "Restore threaded renderer on Windows in windowed mode." This reverts commit 874fa670361de905180932247e6d7d13d04148d7. --- OpenRA.Platforms.Default/Sdl2PlatformWindow.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs b/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs index df72404162..c775a53b2e 100644 --- a/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs +++ b/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs @@ -341,7 +341,15 @@ namespace OpenRA.Platforms.Default // Run graphics rendering on a dedicated thread. // The calling thread will then have more time to process other tasks, since rendering happens in parallel. // If the calling thread is the main game thread, this means it can run more logic and render ticks. - Context = new ThreadedGraphicsContext(new Sdl2GraphicsContext(this), vertexBatchSize, indexBatchSize); + // This is disabled when running in windowed mode on Windows because it breaks the ability to minimize/restore the window. + if (Platform.CurrentPlatform == PlatformType.Windows && windowMode == WindowMode.Windowed) + { + var ctx = new Sdl2GraphicsContext(this); + ctx.InitializeOpenGL(); + Context = ctx; + } + else + Context = new ThreadedGraphicsContext(new Sdl2GraphicsContext(this), vertexBatchSize, indexBatchSize); Context.SetVSyncEnabled(Game.Settings.Graphics.VSync);