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
|
||||
|
||||
@@ -53,7 +53,7 @@ void App::cloud_upload()
|
||||
|
||||
auto m = layout[main_id]->add_child<NodeMessageBox>();
|
||||
m->m_title->set_text("Publish document");
|
||||
m->m_message->set_text("Would you like to upload this document to the public domain?");
|
||||
m->m_message->set_text("Would you like to upload to the public domain?");
|
||||
m->btn_ok->m_text->set_text("Yes");
|
||||
m->btn_cancel->m_text->set_text("No");
|
||||
m->btn_ok->on_click = [this, m, upload_thread](Node*) {
|
||||
|
||||
Reference in New Issue
Block a user