add layout designer
This commit is contained in:
12
src/app.cpp
12
src/app.cpp
@@ -547,6 +547,8 @@ void App::draw(float dt)
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
for (int i = 1; i < layout[main_id]->m_children.size(); i++)
|
||||
layout[main_id]->m_children[i]->watch(observer);
|
||||
for (int i = 0; layout_designer.get(main_id) && i < layout_designer[main_id]->m_children.size(); i++)
|
||||
layout_designer[main_id]->m_children[i]->watch(observer);
|
||||
//msgbox->watch(observer);
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
uirtt.unbindFramebuffer();
|
||||
@@ -563,6 +565,8 @@ void App::draw(float dt)
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
for (int i = 0; i < layout[main_id]->m_children.size(); i++)
|
||||
layout[main_id]->m_children[i]->watch(observer);
|
||||
for (int i = 0; layout_designer.get(main_id) && i < layout_designer[main_id]->m_children.size(); i++)
|
||||
layout_designer[main_id]->m_children[i]->watch(observer);
|
||||
//msgbox->watch(observer);
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
}
|
||||
@@ -617,6 +621,9 @@ void App::update(float dt)
|
||||
if (auto* main = layout[main_id])
|
||||
main->update(width, height, zoom);
|
||||
|
||||
if (auto* main = layout_designer[main_id])
|
||||
main->update(width, height, zoom);
|
||||
|
||||
{
|
||||
static glm::vec4 color_button_normal{ .1, .1, .1, 1 };
|
||||
static glm::vec4 color_button_hlight{ 1, .0, .0, 1 };
|
||||
@@ -651,6 +658,7 @@ void App::terminate()
|
||||
TextureManager::invalidate();
|
||||
ShaderManager::invalidate();
|
||||
layout.unload();
|
||||
layout_designer.unload();
|
||||
uirtt.destroy();
|
||||
m_face_plane.destroy();
|
||||
layers.reset();
|
||||
@@ -921,9 +929,9 @@ void App::ui_thread_main()
|
||||
redraw = true;
|
||||
}
|
||||
if (layout.reload())
|
||||
{
|
||||
redraw = true;
|
||||
}
|
||||
if (layout_designer.reload())
|
||||
redraw = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user