Changed Texture::bind and Shader::bind to be static functions, that can accept a null argument

This commit is contained in:
Laurent Gomila 2013-01-08 22:24:43 +01:00
parent 38da3f4338
commit 91e1743516
5 changed files with 125 additions and 88 deletions

View file

@ -391,10 +391,7 @@ void RenderTarget::applyTransform(const Transform& transform)
////////////////////////////////////////////////////////////
void RenderTarget::applyTexture(const Texture* texture)
{
if (texture)
texture->bind(Texture::Pixels);
else
glCheck(glBindTexture(GL_TEXTURE_2D, 0));
Texture::bind(texture, Texture::Pixels);
m_cache.lastTextureId = texture ? texture->m_cacheId : 0;
}
@ -403,10 +400,7 @@ void RenderTarget::applyTexture(const Texture* texture)
////////////////////////////////////////////////////////////
void RenderTarget::applyShader(const Shader* shader)
{
if (shader)
shader->bind();
else
glCheck(glUseProgramObjectARB(0));
Shader::bind(shader);
}
} // namespace sf