protected override void dispose( bool disposeManagedResources )
{
if ( !isDisposed )
{
if ( disposeManagedResources )
{
if ( _hRenderingContext != IntPtr.Zero )
{ // Do We Not Have A Rendering Context?
if ( !Wgl.wglMakeCurrent( IntPtr.Zero, IntPtr.Zero ) )
{ // Are We Able To Release The DC And RC Contexts?
SWF.MessageBox.Show( "Release Of DC And RC Failed.", "SHUTDOWN ERROR", SWF.MessageBoxButtons.OK, SWF.MessageBoxIcon.Information );
}
if ( !Wgl.wglDeleteContext( _hRenderingContext ) )
{ // Are We Not Able To Delete The RC?
SWF.MessageBox.Show( "Release Rendering Context Failed.", "SHUTDOWN ERROR", SWF.MessageBoxButtons.OK, SWF.MessageBoxIcon.Information );
}
_hRenderingContext = IntPtr.Zero; // Set RC To NULL
}
}
// There are no unmanaged resources to release, but
// if we add them, they need to be released here.
}
// If it is available, make the call to the
// base class's Dispose(Boolean) method
base.dispose( disposeManagedResources );
// make sure this window is no longer active
this.IsActive = false;
}