From 7c4b058c9a9682bf356ef1fa2d6c81e15b15b179 Mon Sep 17 00:00:00 2001 From: Laurent Gomila Date: Mon, 16 Sep 2013 22:30:58 +0200 Subject: [PATCH] The texture matrix is now reset in Texture::bind(NULL) --- src/SFML/Graphics/Texture.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/SFML/Graphics/Texture.cpp b/src/SFML/Graphics/Texture.cpp index 7b5fdb27..033fe0fa 100644 --- a/src/SFML/Graphics/Texture.cpp +++ b/src/SFML/Graphics/Texture.cpp @@ -485,6 +485,13 @@ void Texture::bind(const Texture* texture, CoordinateType coordinateType) { // Bind no texture glCheck(glBindTexture(GL_TEXTURE_2D, 0)); + + // Reset the texture matrix + glCheck(glMatrixMode(GL_TEXTURE)); + glCheck(glLoadIdentity()); + + // Go back to model-view mode (sf::RenderTarget relies on it) + glCheck(glMatrixMode(GL_MODELVIEW)); } }