mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 02:05:28 +00:00
Egl & Cocoa: Don't change context when creating/deleting them
This commit is contained in:
parent
1b6fdd28ca
commit
695dcd4d60
|
@ -98,8 +98,6 @@ namespace OpenTK.Platform.Egl
|
||||||
|
|
||||||
int[] attrib_list = new int[] { Egl.CONTEXT_CLIENT_VERSION, major, Egl.NONE };
|
int[] attrib_list = new int[] { Egl.CONTEXT_CLIENT_VERSION, major, Egl.NONE };
|
||||||
HandleAsEGLContext = Egl.CreateContext(window.Display, config, shared != null ? shared.HandleAsEGLContext : IntPtr.Zero, attrib_list);
|
HandleAsEGLContext = Egl.CreateContext(window.Display, config, shared != null ? shared.HandleAsEGLContext : IntPtr.Zero, attrib_list);
|
||||||
|
|
||||||
MakeCurrent(window);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public EglContext(ContextHandle handle, EglWindowInfo window, IGraphicsContext sharedContext,
|
public EglContext(ContextHandle handle, EglWindowInfo window, IGraphicsContext sharedContext,
|
||||||
|
@ -199,7 +197,8 @@ namespace OpenTK.Platform.Egl
|
||||||
{
|
{
|
||||||
if (manual)
|
if (manual)
|
||||||
{
|
{
|
||||||
Egl.MakeCurrent(WindowInfo.Display, WindowInfo.Surface, WindowInfo.Surface, IntPtr.Zero);
|
if (IsCurrent)
|
||||||
|
Egl.MakeCurrent(WindowInfo.Display, WindowInfo.Surface, WindowInfo.Surface, IntPtr.Zero);
|
||||||
Egl.DestroyContext(WindowInfo.Display, HandleAsEGLContext);
|
Egl.DestroyContext(WindowInfo.Display, HandleAsEGLContext);
|
||||||
}
|
}
|
||||||
IsDisposed = true;
|
IsDisposed = true;
|
||||||
|
|
|
@ -143,7 +143,6 @@ namespace OpenTK
|
||||||
Mode = GetGraphicsMode(context);
|
Mode = GetGraphicsMode(context);
|
||||||
|
|
||||||
Update(cocoaWindow);
|
Update(cocoaWindow);
|
||||||
MakeCurrent(cocoaWindow);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private IntPtr SelectPixelFormat(GraphicsMode mode, int majorVersion, int minorVersion)
|
private IntPtr SelectPixelFormat(GraphicsMode mode, int majorVersion, int minorVersion)
|
||||||
|
@ -336,7 +335,8 @@ namespace OpenTK
|
||||||
if (!NSApplication.IsUIThread)
|
if (!NSApplication.IsUIThread)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Cocoa.SendVoid(NSOpenGLContext, Selector.Get("clearCurrentContext"));
|
if (IsCurrent)
|
||||||
|
Cocoa.SendVoid(NSOpenGLContext, Selector.Get("clearCurrentContext"));
|
||||||
Cocoa.SendVoid(Handle.Handle, Selector.Get("clearDrawable"));
|
Cocoa.SendVoid(Handle.Handle, Selector.Get("clearDrawable"));
|
||||||
Cocoa.SendVoid(Handle.Handle, Selector.Get("release"));
|
Cocoa.SendVoid(Handle.Handle, Selector.Get("release"));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue