diff --git a/src/SFML/Graphics/RenderTarget.cpp b/src/SFML/Graphics/RenderTarget.cpp index 7eccf829..59e9e202 100644 --- a/src/SFML/Graphics/RenderTarget.cpp +++ b/src/SFML/Graphics/RenderTarget.cpp @@ -129,7 +129,7 @@ RenderTarget::RenderTarget() : m_defaultView(), m_view (), m_cache (), -m_id (getUniqueId()) +m_id (0) { m_cache.glStatesSet = false; } @@ -547,6 +547,10 @@ void RenderTarget::initialize() // Set GL states only on first draw, so that we don't pollute user's states m_cache.glStatesSet = false; + + // Generate a unique ID for this RenderTarget to track + // whether it is active within a specific context + m_id = getUniqueId(); }