mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Fix white square problem in OpenGL example
Because the sf::Texture::m_texture value changes when the texture is reloaded from disk, we need to rebind the texture since the previously bound sf::Texture::m_texture value is no longer a valid identifier.
This commit is contained in:
parent
72eb115551
commit
5eb57ae5f1
@ -221,6 +221,9 @@ int main()
|
|||||||
// We simply reload the texture to disable mipmapping
|
// We simply reload the texture to disable mipmapping
|
||||||
texture = sf::Texture::loadFromFile(resourcesDir() / "logo.png").value();
|
texture = sf::Texture::loadFromFile(resourcesDir() / "logo.png").value();
|
||||||
|
|
||||||
|
// Rebind the texture
|
||||||
|
sf::Texture::bind(&texture);
|
||||||
|
|
||||||
mipmapEnabled = false;
|
mipmapEnabled = false;
|
||||||
}
|
}
|
||||||
else if (texture.generateMipmap())
|
else if (texture.generateMipmap())
|
||||||
|
Loading…
Reference in New Issue
Block a user