Minor modification in sf::Renderer

git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1757 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
LaurentGom 2010-12-19 17:17:30 +00:00
parent 9d777f43e5
commit 23d0ee8550

View File

@ -246,7 +246,7 @@ void Renderer::SetTexture(const Image* texture)
myTextureId = texture ? texture->myTexture : 0; myTextureId = texture ? texture->myTexture : 0;
myTextureIsValid = true; myTextureIsValid = true;
} }
else if (texture) else if (texture && myTextureIsValid)
{ {
// If the texture was already the current one, make sure that // If the texture was already the current one, make sure that
// it is synchronized (in case it was modified since last use) // it is synchronized (in case it was modified since last use)
@ -273,7 +273,7 @@ void Renderer::SetShader(const Shader* shader)
myShaderIsValid = true; myShaderIsValid = true;
} }
} }
else if (shader) else if (shader && myShaderIsValid)
{ {
// If the shader was already the current one, make sure that // If the shader was already the current one, make sure that
// it is synchronized (in case it was modified since last use) // it is synchronized (in case it was modified since last use)