示例#1
0
 public void Dispose()
 {
     if (_selfCreatedWindow)
     {
         OpenGLContext?.Dispose();
     }
 }
示例#2
0
        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();
 }