From fe39af4ec8ffb8d67e55a2e3aee33e3b6c3091aa Mon Sep 17 00:00:00 2001 From: binary1248 Date: Wed, 8 Nov 2017 15:30:28 +0100 Subject: [PATCH] Worked around render target bug on macOS --- src/SFML/Graphics/RenderTarget.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/SFML/Graphics/RenderTarget.cpp b/src/SFML/Graphics/RenderTarget.cpp index 2dce1b407..cba622cd0 100644 --- a/src/SFML/Graphics/RenderTarget.cpp +++ b/src/SFML/Graphics/RenderTarget.cpp @@ -373,6 +373,12 @@ void RenderTarget::resetGLStates() // Check here to make sure a context change does not happen after activate(true) bool shaderAvailable = Shader::isAvailable(); + // Workaround for states not being properly reset on + // macOS unless a context switch really takes place + #if defined(SFML_SYSTEM_MACOS) + setActive(false); + #endif + if (setActive(true)) { // Make sure that extensions are initialized