Axiom.RenderSystems.OpenGL.GLContext.SetCurrent C# (CSharp) Метод

SetCurrent() публичный абстрактный Метод

Enable the context. All subsequent rendering commands will go here.
public abstract SetCurrent ( ) : void
Результат void
		public abstract void SetCurrent();

Usage Example

Пример #1
0
		private void _switchContext( GLContext context )
		{
			// Unbind GPU programs and rebind to new context later, because
			// scene manager treat render system as ONE 'context' ONLY, and it
			// cached the GPU programs using state.
			if ( currentVertexProgram != null )
				currentVertexProgram.Unbind();
			if ( currentFragmentProgram != null )
				currentFragmentProgram.Unbind();
            if (currentGeometryProgram != null)
                currentGeometryProgram.Unbind();

            // Disable lights
            for (var i = 0 ; i < _currentLights; i++ )
			{
				SetGLLight( i, null );
				lights[ i ] = null;
			}
            _currentLights = 0;

            // Disable textures
            DisableTextureUnitsFrom(0);

			// It's ready to switching
			_currentContext.EndCurrent();
			_currentContext = context;
			_currentContext.SetCurrent();

			// Check if the context has already done one-time initialisation
			if ( !_currentContext.Initialized )
			{
				OneTimeContextInitialization();
				_currentContext.Initialized = true;
			}

			// Rebind GPU programs to new context
			if ( currentVertexProgram != null )
				currentVertexProgram.Bind();
			if ( currentFragmentProgram != null )
				currentFragmentProgram.Bind();
            if (currentGeometryProgram != null)
                currentGeometryProgram.Bind();

			// Must reset depth/color write mask to according with user desired, otherwise,
			// clearFrameBuffer would be wrong because the value we are recorded may be
			// difference with the really state stored in GL context.
			Gl.glDepthMask( depthWrite ? 1 : 0 ); // Tao 2.0
			Gl.glColorMask( ColorWrite[ 0 ], ColorWrite[ 1 ], ColorWrite[ 2 ], ColorWrite[ 3 ] );
			Gl.glStencilMask( stencilMask );
        }