Axiom.RenderSystems.DirectX9.D3DRenderSystem.SetVertexTexture C# (CSharp) Метод

SetVertexTexture() приватный метод

private SetVertexTexture ( int stage, Axiom.Core.Texture texture ) : void
stage int
texture Axiom.Core.Texture
Результат void
        public override void SetVertexTexture( int stage, Texture texture )
        {
            if ( texture == null )
            {
                if ( _texStageDesc[ stage ].vertexTex != null )
                {
                    var result = ActiveD3D9Device.SetTexture( ( (int)VertexTextureSampler.Sampler0 ) + stage, null );
                    if ( result.IsFailure )
                    {
                        throw new AxiomException( "Unable to disable vertex texture '{0}' in D3D9.", stage );
                    }
                }
                _texStageDesc[ stage ].vertexTex = null;
            }
            else
            {
                var dt = (D3DTexture)texture;
                // note used
                dt.Touch();

                var ptex = dt.DXTexture;

                if ( _texStageDesc[ stage ].vertexTex != ptex )
                {
                    var result = ActiveD3D9Device.SetTexture(((int)VertexTextureSampler.Sampler0) + stage, ptex);
                    if ( result.IsFailure )
                    {
                        throw new AxiomException("Unable to set vertex texture '{0}' in D3D9.", dt.Name);
                    }
                }
                _texStageDesc[ stage ].vertexTex = ptex;
            }
        }
D3DRenderSystem