From e39e4fbb378e8d2e98c5e76583b311614d166998 Mon Sep 17 00:00:00 2001 From: thefiddler Date: Sun, 15 Jun 2014 14:32:43 +0200 Subject: [PATCH] [X11] Construct X11 Factory first if enabled This allows us to use X11 on Windows and Mac, if explicitly requested by the user via `ToolkitOptions.Backend`. --- Source/OpenTK/Platform/Factory.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/OpenTK/Platform/Factory.cs b/Source/OpenTK/Platform/Factory.cs index 14185d3b..9a701844 100644 --- a/Source/OpenTK/Platform/Factory.cs +++ b/Source/OpenTK/Platform/Factory.cs @@ -53,9 +53,9 @@ namespace OpenTK.Platform // Create regular platform backend if (Configuration.RunningOnSdl2) Default = new SDL2.Sdl2Factory(); + else if (Configuration.RunningOnX11) Default = new X11.X11Factory(); else if (Configuration.RunningOnWindows) Default = new Windows.WinFactory(); else if (Configuration.RunningOnMacOS) Default = new MacOS.MacOSFactory(); - else if (Configuration.RunningOnX11) Default = new X11.X11Factory(); else Default = new UnsupportedPlatform(); // Create embedded platform backend for EGL / OpenGL ES. @@ -70,9 +70,9 @@ namespace OpenTK.Platform } else if (Egl.Egl.IsSupported) { - if (Configuration.RunningOnWindows) Embedded = new Egl.EglWinPlatformFactory(); + if (Configuration.RunningOnX11) Embedded = new Egl.EglX11PlatformFactory(); + else if (Configuration.RunningOnWindows) Embedded = new Egl.EglWinPlatformFactory(); else if (Configuration.RunningOnMacOS) Embedded = new Egl.EglMacPlatformFactory(); - else if (Configuration.RunningOnX11) Embedded = new Egl.EglX11PlatformFactory(); else Embedded = new UnsupportedPlatform(); } else