From c958bf968018f8d94f0d394f2a4661ad10cd1ff9 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 26 Sep 2021 13:14:52 +0100 Subject: [PATCH] Restore threaded renderer. --- OpenRA.Platforms.Default/Sdl2PlatformWindow.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs b/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs index 4bfaa274fd..da316de02b 100644 --- a/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs +++ b/OpenRA.Platforms.Default/Sdl2PlatformWindow.cs @@ -303,9 +303,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. - var ctx = new Sdl2GraphicsContext(this); - ctx.InitializeOpenGL(); - context = ctx; + // 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), batchSize); context.SetVSyncEnabled(Game.Settings.Graphics.VSync);