/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { if (_Handle != IntPtr.Zero) { if (Wgl.CurrentExtensions.Pbuffer_ARB) { bool res = Wgl.DestroyPbufferARB(_Handle); Debug.Assert(res); } else { bool res = Wgl.DestroyPbufferEXT(_Handle); Debug.Assert(res); } _Handle = IntPtr.Zero; } if (_DeviceContext != IntPtr.Zero) { Wgl.ReleaseDC(IntPtr.Zero, _DeviceContext); _DeviceContext = IntPtr.Zero; } }