public override GLContext Clone()
{
// Create new context based on own HDC
IntPtr newCtx = Wgl.wglCreateContext( _hDeviceContext );
if ( newCtx == IntPtr.Zero )
{
throw new Exception( "Error calling wglCreateContext" );
}
Wgl.wglMakeCurrent( IntPtr.Zero, IntPtr.Zero );
// Share lists with old context
if ( !Wgl.wglShareLists( _hRenderingContext, newCtx ) )
{
Wgl.wglDeleteContext( newCtx );
throw new Exception( "wglShareLists() failed: " );
}
return new Win32Context( _hDeviceContext, newCtx );
}