Axiom.RenderSystems.OpenGL.Win32Context.Clone C# (CSharp) Метод

Clone() публичный Метод

public Clone ( ) : GLContext
Результат GLContext
		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 );
		}