Restore threaded renderer.
This commit is contained in:
@@ -303,9 +303,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.
|
||||||
var ctx = new Sdl2GraphicsContext(this);
|
// This is disabled when running in windowed mode on Windows because it breaks the ability to minimize/restore the window.
|
||||||
ctx.InitializeOpenGL();
|
if (Platform.CurrentPlatform == PlatformType.Windows && windowMode == WindowMode.Windowed)
|
||||||
context = ctx;
|
{
|
||||||
|
var ctx = new Sdl2GraphicsContext(this);
|
||||||
|
ctx.InitializeOpenGL();
|
||||||
|
context = ctx;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
context = new ThreadedGraphicsContext(new Sdl2GraphicsContext(this), batchSize);
|
||||||
|
|
||||||
context.SetVSyncEnabled(Game.Settings.Graphics.VSync);
|
context.SetVSyncEnabled(Game.Settings.Graphics.VSync);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user