[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`.
This commit is contained in:
thefiddler 2014-06-15 14:32:43 +02:00
parent 9d840e5969
commit e39e4fbb37

View file

@ -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