public void Dispose() { if (_selfCreatedWindow) { OpenGLContext?.Dispose(); } }
protected override void Dispose(bool disposing) { // Try to bind the OpenGL context before calling the shutdown event try { OpenGLContext?.MakeCurrent(NativeWindow); } catch (Exception) { } ShuttingDown?.Invoke(this, EventArgs.Empty); // Unbind context and destroy everything try { OpenGLContext?.MakeCurrent(null); } catch (Exception) { } OpenGLContext.Dispose(); }
private void Cleanup() { context.Dispose(); }