add mutex to App::update, move custom app-glue to git submodule
This commit is contained in:
27
src/app.cpp
27
src/app.cpp
@@ -443,7 +443,11 @@ void App::async_end()
|
||||
|
||||
void App::update(float dt)
|
||||
{
|
||||
static std::mutex mutex;
|
||||
static float rec_timer = 0.f;
|
||||
|
||||
// avoid multiple threads to update the scene
|
||||
std::lock_guard<std::mutex> lock(mutex);
|
||||
|
||||
static std::mutex m;
|
||||
std::lock_guard<std::mutex> _lock(m);
|
||||
@@ -511,16 +515,19 @@ void App::update(float dt)
|
||||
}
|
||||
return false;
|
||||
};
|
||||
/*
|
||||
uirtt.bindFramebuffer();
|
||||
uirtt.clear();
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
for (int i = 1; i < layout[main_id]->m_children.size(); i++)
|
||||
layout[main_id]->m_children[i]->watch(observer);
|
||||
//msgbox->watch(observer);
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
uirtt.unbindFramebuffer();
|
||||
*/
|
||||
|
||||
if (vr_active)
|
||||
{
|
||||
uirtt.bindFramebuffer();
|
||||
uirtt.clear();
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
for (int i = 1; i < layout[main_id]->m_children.size(); i++)
|
||||
layout[main_id]->m_children[i]->watch(observer);
|
||||
//msgbox->watch(observer);
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
uirtt.unbindFramebuffer();
|
||||
}
|
||||
|
||||
#if __IOS__
|
||||
[ios_view->glview bindDrawable];
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user