mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 11:35:39 +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.
|
||||
return (GraphicsContext.GetCurrentContextDelegate)delegate
|
||||
{
|
||||
IntPtr current;
|
||||
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);
|
||||
return Sdl2GraphicsContext.GetCurrentContext();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -254,6 +254,15 @@ namespace OpenTK.Platform.SDL2
|
|||
|
||||
#endregion
|
||||
|
||||
#region Public Members
|
||||
|
||||
public static ContextHandle GetCurrentContext()
|
||||
{
|
||||
return new ContextHandle(SDL.GL.GetCurrentContext());
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region GraphicsContextBase Members
|
||||
|
||||
public override void SwapBuffers()
|
||||
|
|
Loading…
Reference in a new issue