public void Dispose() { lock (this.object_0) { if (!(this.intptr_2 != IntPtr.Zero)) { return; } if (WGL.wglDeleteContext(this.intptr_2) == 0) { int lastWin32Error = Marshal.GetLastWin32Error(); throw new Win32Exception(lastWin32Error, string.Format("OpenGL DeleteContext call was not successful, error code: {0}", (object)lastWin32Error)); } this.intptr_2 = IntPtr.Zero; if (this.bool_0) { if (WGL.DeleteDC(this.intptr_1) == 0) { int lastWin32Error = Marshal.GetLastWin32Error(); throw new Win32Exception(lastWin32Error, string.Format("OpenGL DeleteDC call was not successful, error code: {0}", (object)lastWin32Error)); } } else if (WGL.ReleaseDC(this.intptr_0, this.intptr_1) == 0) { int lastWin32Error = Marshal.GetLastWin32Error(); throw new Win32Exception(lastWin32Error, string.Format("OpenGL ReleaseDC call was not successful, error code: {0}", (object)lastWin32Error)); } this.intptr_0 = IntPtr.Zero; this.intptr_1 = IntPtr.Zero; this.int_0 = 0; } }