Disable the threaded renderer on Windows.
A DisableWindowsRenderThread graphics setting is added to allow players to optionally reenable it.
This commit is contained in:
@@ -130,6 +130,9 @@ namespace OpenRA
|
|||||||
[Desc("Disable high resolution DPI scaling on Windows operating systems.")]
|
[Desc("Disable high resolution DPI scaling on Windows operating systems.")]
|
||||||
public bool DisableWindowsDPIScaling = true;
|
public bool DisableWindowsDPIScaling = true;
|
||||||
|
|
||||||
|
[Desc("Disable separate OpenGL render thread on Windows operating systems.")]
|
||||||
|
public bool DisableWindowsRenderThread = true;
|
||||||
|
|
||||||
public int BatchSize = 8192;
|
public int BatchSize = 8192;
|
||||||
public int SheetSize = 2048;
|
public int SheetSize = 2048;
|
||||||
|
|
||||||
|
|||||||
@@ -187,6 +187,15 @@ namespace OpenRA.Platforms.Default
|
|||||||
// Run graphics rendering on a dedicated thread.
|
// Run graphics rendering on a dedicated thread.
|
||||||
// The calling thread will then have more time to process other tasks, since rendering happens in parallel.
|
// 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.
|
// If the calling thread is the main game thread, this means it can run more logic and render ticks.
|
||||||
|
// 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);
|
context = new ThreadedGraphicsContext(new Sdl2GraphicsContext(this), batchSize);
|
||||||
|
|
||||||
SDL.SDL_SetModState(SDL.SDL_Keymod.KMOD_NONE);
|
SDL.SDL_SetModState(SDL.SDL_Keymod.KMOD_NONE);
|
||||||
|
|||||||
Reference in New Issue
Block a user