Fixed texture cache not properly updated when a same sf::Image instance allocated a new OpenGL texture internally
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1631 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
0e2297af28
commit
230f5e58ca
2 changed files with 3 additions and 13 deletions
|
@ -46,12 +46,6 @@ myViewportIsValid (false)
|
|||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
Renderer::~Renderer()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
void Renderer::Initialize()
|
||||
{
|
||||
|
@ -239,7 +233,7 @@ void Renderer::SetBlendMode(Blend::Mode mode)
|
|||
////////////////////////////////////////////////////////////
|
||||
void Renderer::SetTexture(const Image* texture)
|
||||
{
|
||||
if ((texture != myTexture) || !myTextureIsValid)
|
||||
if ((texture != myTexture) || (texture && (texture->myTexture != myTextureId)) || !myTextureIsValid)
|
||||
{
|
||||
// Apply the new texture
|
||||
if (texture)
|
||||
|
@ -249,6 +243,7 @@ void Renderer::SetTexture(const Image* texture)
|
|||
|
||||
// Store it
|
||||
myTexture = texture;
|
||||
myTextureId = texture ? texture->myTexture : 0;
|
||||
myTextureIsValid = true;
|
||||
}
|
||||
else if (texture)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue