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);
-
- MakeCurrent(window);
}
public EglContext(ContextHandle handle, EglWindowInfo window, IGraphicsContext sharedContext,
{
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);
}
IsDisposed = true;
Mode = GetGraphicsMode(context);
Update(cocoaWindow);
- MakeCurrent(cocoaWindow);
}
private IntPtr SelectPixelFormat(GraphicsMode mode, int majorVersion, int minorVersion)
if (!NSApplication.IsUIThread)
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("release"));