IGraphicsDataToken and IGraphicsCommandQueue::stopRenderer()

This commit is contained in:
Jack Andersen
2015-12-04 14:41:30 -10:00
parent 32d4797ac6
commit d145e15ecb
9 changed files with 81 additions and 28 deletions

View File

@@ -557,7 +557,7 @@ void GLDataFactory::reset()
m_deferredData = new struct GLData();
}
IGraphicsData* GLDataFactory::commit()
IGraphicsDataToken GLDataFactory::commit()
{
GLData* retval = m_deferredData;
m_deferredData = new struct GLData();
@@ -566,7 +566,7 @@ IGraphicsData* GLDataFactory::commit()
While this isn't strictly required, some drivers might behave
differently */
glFlush();
return retval;
return IGraphicsDataToken(this, retval);
}
void GLDataFactory::destroyData(IGraphicsData* d)
@@ -900,13 +900,18 @@ struct GLCommandQueue : IGraphicsCommandQueue
m_initlk.unlock();
}
~GLCommandQueue()
void stopRenderer()
{
m_running = false;
m_cv.notify_one();
m_thr.join();
}
~GLCommandQueue()
{
if (m_running) stopRenderer();
}
void setShaderDataBinding(IShaderDataBinding* binding)
{
std::vector<Command>& cmds = m_cmdBufs[m_fillBuf];