-
-
Save binary1248/cc2c361ee4f425f6febc to your computer and use it in GitHub Desktop.
Context crash fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
src/SFML/Graphics/RenderTarget.cpp | 4 +++- | |
1 file changed, 3 insertions(+), 1 deletion(-) | |
diff --git a/src/SFML/Graphics/RenderTarget.cpp b/src/SFML/Graphics/RenderTarget.cpp | |
index e7ee147..69edd67 100644 | |
--- a/src/SFML/Graphics/RenderTarget.cpp | |
+++ b/src/SFML/Graphics/RenderTarget.cpp | |
@@ -340,6 +340,8 @@ void RenderTarget::popGLStates() | |
//////////////////////////////////////////////////////////// | |
void RenderTarget::resetGLStates() | |
{ | |
+ bool shaderAvailable = Shader::isAvailable(); | |
+ | |
if (activate(true)) | |
{ | |
// Make sure that extensions are initialized | |
@@ -362,7 +364,7 @@ void RenderTarget::resetGLStates() | |
applyBlendMode(BlendAlpha); | |
applyTransform(Transform::Identity); | |
applyTexture(NULL); | |
- if (Shader::isAvailable()) | |
+ if (shaderAvailable) | |
applyShader(NULL); | |
m_cache.useVertexCache = false; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment