Postpone generation of the RenderTarget ID to RenderTarget::initialize() so that a new ID is generated whenever the RenderTarget is re-create()ed.

This commit is contained in:
binary1248 2018-05-16 01:26:17 +02:00 committed by Lukas Dürrenberger
parent 88bb3f89a5
commit bb3bd05823

View File

@ -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();
}