mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-08 13:30:45 +00:00
More sane Sdl2Factory.CreateGetCurrentContext() implementation
This commit is contained in:
parent
29fe1052de
commit
e0ffd9b42d
|
@ -69,19 +69,7 @@ namespace OpenTK.Platform.SDL2
|
||||||
// so we need to implement our own.
|
// so we need to implement our own.
|
||||||
return (GraphicsContext.GetCurrentContextDelegate)delegate
|
return (GraphicsContext.GetCurrentContextDelegate)delegate
|
||||||
{
|
{
|
||||||
IntPtr current;
|
return Sdl2GraphicsContext.GetCurrentContext();
|
||||||
if (Configuration.RunningOnWindows)
|
|
||||||
current = OpenTK.Platform.Windows.Wgl.Imports.GetCurrentContext();
|
|
||||||
else if (Configuration.RunningOnX11)
|
|
||||||
current = OpenTK.Platform.X11.Glx.GetCurrentContext();
|
|
||||||
else if (Configuration.RunningOnMacOS)
|
|
||||||
current = OpenTK.Platform.MacOS.Cgl.GetCurrentContext();
|
|
||||||
else if (Configuration.RunningOnAndroid)
|
|
||||||
current = OpenTK.Platform.Egl.Egl.GetCurrentContext();
|
|
||||||
else
|
|
||||||
throw new NotSupportedException("Unknown platform, please report to http://www.opentk.com");
|
|
||||||
|
|
||||||
return new ContextHandle(current);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -254,6 +254,15 @@ namespace OpenTK.Platform.SDL2
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Public Members
|
||||||
|
|
||||||
|
public static ContextHandle GetCurrentContext()
|
||||||
|
{
|
||||||
|
return new ContextHandle(SDL.GL.GetCurrentContext());
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region GraphicsContextBase Members
|
#region GraphicsContextBase Members
|
||||||
|
|
||||||
public override void SwapBuffers()
|
public override void SwapBuffers()
|
||||||
|
|
Loading…
Reference in a new issue