Skip to content

Commit

Permalink
Restore threaded renderer.
Browse files Browse the repository at this point in the history
  • Loading branch information
pchote authored and abcdefg30 committed Sep 26, 2021
1 parent 98b8700 commit c958bf9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions OpenRA.Platforms.Default/Sdl2PlatformWindow.cs
Expand Up @@ -303,9 +303,15 @@ public GLProfile[] SupportedGLProfiles
// 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);

Expand Down

0 comments on commit c958bf9

Please sign in to comment.