mirror of
https://github.com/SFML/SFML.git
synced 2025-01-19 15:55:13 +08:00
Fix application crash when calling Shader::isAvailable() #608.
This commit is contained in:
parent
2215f55ef9
commit
a3ab6efa23
@ -340,6 +340,9 @@ void RenderTarget::popGLStates()
|
|||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
void RenderTarget::resetGLStates()
|
void RenderTarget::resetGLStates()
|
||||||
{
|
{
|
||||||
|
// Check here to make sure a context change does not happen after activate(true)
|
||||||
|
bool shaderAvailable = Shader::isAvailable();
|
||||||
|
|
||||||
if (activate(true))
|
if (activate(true))
|
||||||
{
|
{
|
||||||
// Make sure that extensions are initialized
|
// Make sure that extensions are initialized
|
||||||
@ -362,7 +365,7 @@ void RenderTarget::resetGLStates()
|
|||||||
applyBlendMode(BlendAlpha);
|
applyBlendMode(BlendAlpha);
|
||||||
applyTransform(Transform::Identity);
|
applyTransform(Transform::Identity);
|
||||||
applyTexture(NULL);
|
applyTexture(NULL);
|
||||||
if (Shader::isAvailable())
|
if (shaderAvailable)
|
||||||
applyShader(NULL);
|
applyShader(NULL);
|
||||||
m_cache.useVertexCache = false;
|
m_cache.useVertexCache = false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user