From c3fb58b33fc5d0e41fc818983d1c34ff5940bd26 Mon Sep 17 00:00:00 2001 From: Laurent Gomila Date: Sat, 7 Jul 2012 21:38:57 +0200 Subject: [PATCH] Texture::bind no longer crashes when the texture is invalid --- src/SFML/Graphics/Texture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SFML/Graphics/Texture.cpp b/src/SFML/Graphics/Texture.cpp index 926e8bcf..5b0db339 100644 --- a/src/SFML/Graphics/Texture.cpp +++ b/src/SFML/Graphics/Texture.cpp @@ -380,7 +380,7 @@ void Texture::bind(CoordinateType coordinateType) const glCheck(glBindTexture(GL_TEXTURE_2D, m_texture)); // Check if we need to define a special texture matrix - if ((coordinateType == Pixels) || m_pixelsFlipped) + if (m_texture && ((coordinateType == Pixels) || m_pixelsFlipped)) { GLfloat matrix[16] = {1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f,