Disable the threaded renderer on Windows.

A DisableWindowsRenderThread graphics setting is
added to allow players to optionally reenable it.
This commit is contained in:
Paul Chote
2018-08-04 14:39:26 +01:00
committed by reaperrr
parent 599e87c4aa
commit 3661dbdfd0
2 changed files with 13 additions and 1 deletions

View File

@@ -187,7 +187,16 @@ 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), batchSize);
// This is disabled on Windows because it breaks the ability to minimize/restore the window from the taskbar for reasons that we dont understand.
var threadedRenderer = Platform.CurrentPlatform != PlatformType.Windows || !Game.Settings.Graphics.DisableWindowsRenderThread;
if (threadedRenderer)
{
var ctx = new Sdl2GraphicsContext(this);
ctx.InitializeOpenGL();
context = ctx;
}
else
context = new ThreadedGraphicsContext(new Sdl2GraphicsContext(this), batchSize);
SDL.SDL_SetModState(SDL.SDL_Keymod.KMOD_NONE);
input = new Sdl2Input();