2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 16:27:42 +00:00

DeferredWindowEvents class to prevent race conditions

This commit is contained in:
Jack Andersen
2015-11-30 14:35:45 -10:00
parent 46916d6fac
commit fc2a6d64e9
7 changed files with 295 additions and 30 deletions

View File

@@ -429,16 +429,18 @@ void TextView::think()
void TextView::draw(boo::IGraphicsCommandQueue* gfxQ)
{
View::draw(gfxQ);
int pendingSlot = 1 << gfxQ->pendingDynamicSlot();
if ((m_validSlots & pendingSlot) == 0)
{
m_glyphBuf->load(m_glyphs.data(), m_glyphs.size() * sizeof(RenderGlyph));
m_validSlots |= pendingSlot;
}
gfxQ->setShaderDataBinding(m_shaderBinding);
gfxQ->setDrawPrimitive(boo::Primitive::TriStrips);
if (m_glyphs.size())
{
int pendingSlot = 1 << gfxQ->pendingDynamicSlot();
if ((m_validSlots & pendingSlot) == 0)
{
m_glyphBuf->load(m_glyphs.data(), m_glyphs.size() * sizeof(RenderGlyph));
m_validSlots |= pendingSlot;
}
gfxQ->setShaderDataBinding(m_shaderBinding);
gfxQ->setDrawPrimitive(boo::Primitive::TriStrips);
gfxQ->drawInstances(0, 4, m_glyphs.size());
}
}