mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Cleanup.
This commit is contained in:
parent
3813b28e9b
commit
132b0c9a1b
1 changed files with 21 additions and 15 deletions
36
src/bgfx.cpp
36
src/bgfx.cpp
|
@ -753,24 +753,30 @@ namespace bgfx
|
|||
|
||||
RenderFrame::Enum renderFrame()
|
||||
{
|
||||
if (NULL == s_ctx)
|
||||
if (BX_ENABLED(BGFX_CONFIG_MULTITHREADED) )
|
||||
{
|
||||
s_renderFrameCalled = true;
|
||||
s_threadIndex = ~BGFX_MAIN_THREAD_MAGIC;
|
||||
return RenderFrame::NoContext;
|
||||
if (NULL == s_ctx)
|
||||
{
|
||||
s_renderFrameCalled = true;
|
||||
s_threadIndex = ~BGFX_MAIN_THREAD_MAGIC;
|
||||
return RenderFrame::NoContext;
|
||||
}
|
||||
|
||||
BGFX_CHECK_RENDER_THREAD();
|
||||
if (s_ctx->renderFrame() )
|
||||
{
|
||||
Context* ctx = s_ctx;
|
||||
ctx->gameSemWait();
|
||||
s_ctx = NULL;
|
||||
ctx->renderSemPost();
|
||||
return RenderFrame::Exiting;
|
||||
}
|
||||
|
||||
return RenderFrame::Render;
|
||||
}
|
||||
|
||||
BGFX_CHECK_RENDER_THREAD();
|
||||
if (s_ctx->renderFrame() )
|
||||
{
|
||||
Context* ctx = s_ctx;
|
||||
ctx->gameSemWait();
|
||||
s_ctx = NULL;
|
||||
ctx->renderSemPost();
|
||||
return RenderFrame::Exiting;
|
||||
}
|
||||
|
||||
return RenderFrame::Render;
|
||||
BX_CHECK(false, "This call only makes sense if used with multi-threaded renderer.");
|
||||
return RenderFrame::NoContext;
|
||||
}
|
||||
|
||||
const uint32_t g_uniformTypeSize[UniformType::Count+1] =
|
||||
|
|
Loading…
Reference in a new issue