From bf98acc61f56fcc927cb340170010ddd0ed4c03f Mon Sep 17 00:00:00 2001 From: binary1248 Date: Mon, 9 Dec 2019 00:57:15 +0100 Subject: [PATCH] Force OpenGL states to be reset when RenderTarget detects that a new context has to be tracked. In the case a context is re-created, FBO RenderTextures would not trigger resetting of the OpenGL states if they were drawn to first since re-initialization of the RenderTarget only happens when a context owner such as a RenderWindow is re-created. Fixes #1625. --- src/SFML/Graphics/RenderTarget.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SFML/Graphics/RenderTarget.cpp b/src/SFML/Graphics/RenderTarget.cpp index 4ae96a20b..a9c0ecace 100644 --- a/src/SFML/Graphics/RenderTarget.cpp +++ b/src/SFML/Graphics/RenderTarget.cpp @@ -405,6 +405,7 @@ bool RenderTarget::setActive(bool active) { contextRenderTargetMap[contextId] = m_id; + m_cache.glStatesSet = false; m_cache.enable = false; } else if (iter->second != m_id)