Changed Texture::bind and Shader::bind to be static functions, that can accept a null argument
This commit is contained in:
parent
38da3f4338
commit
91e1743516
5 changed files with 125 additions and 88 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue