private bool ActivateGLTextureUnit( int unit )
{
if ( _activeTextureUnit != unit )
{
if ( unit < HardwareCapabilities.VertexTextureUnitCount )
{
OpenGL.ActiveTexture( All.Texture0 + unit );
GLESConfig.GlCheckError( this );
_activeTextureUnit = (short)unit;
return true;
}
else if ( unit == 0 )
{
// always ok to use the first unit
return true;
}
else
{
return false;
}
}
else
{
return true;
}
}