Axiom.RenderSystems.OpenGLES.GLESRenderSystem.SetTexture C# (CSharp) Method

SetTexture() public method

public SetTexture ( int stage, bool enabled, Texture texture ) : void
stage int
enabled bool
texture Texture
return void
		public override void SetTexture( int stage, bool enabled, Texture texture )
		{
			GLESConfig.GlCheckError( this );

			// TODO We need control texture types?????

			GLESTexture tex = texture as GLESTexture;

			if ( !ActivateGLTextureUnit( stage ) )
				return;

			if ( enabled )
			{
				if ( tex != null )
				{
					// note used
					tex.Touch();
				}
				OpenGL.Enable( All.Texture2D );
				GLESConfig.GlCheckError( this );
				// Store the number of mipmaps
				_textureMipmapCount = tex.MipmapCount;

				if ( tex != null )
				{
					OpenGL.BindTexture( All.Texture2D, tex.TextureID );
					GLESConfig.GlCheckError( this );
				}
				else
				{
					OpenGL.BindTexture( All.Texture2D, ( (GLESTextureManager)textureManager ).WarningTextureID );
					GLESConfig.GlCheckError( this );
				}
			}//end if enabled
			else
			{
				OpenGL.Enable( All.Texture2D );
				OpenGL.Disable( All.Texture2D );
				GLESConfig.GlCheckError( this );

				OpenGL.TexEnv( All.TextureEnv, All.TextureEnvMode, (int)All.Modulate );
				GLESConfig.GlCheckError( this );

				// bind zero texture
				OpenGL.BindTexture( All.Texture2D, 0 );
				GLESConfig.GlCheckError( this );
			}

			ActivateGLTextureUnit( 0 );
		}
		/// <summary>
GLESRenderSystem