refactor layout loading to add multiple layout, templates and references

This commit is contained in:
2017-02-01 20:35:57 +00:00
parent ed02e38805
commit 70792669e7
5 changed files with 97 additions and 51 deletions

View File

@@ -75,7 +75,7 @@ void App::init()
#endif
layout.load("data/layout.xml");
layout.update(width, height);
//layout.update(width, height);
sampler.create();
ShaderManager::create(kShader::Texture, shader_v, shader_f);
@@ -123,16 +123,16 @@ void App::update(float dt)
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
glEnable(GL_SCISSOR_TEST);
for (auto& n : layout)
{
if (n.m_widget)
{
auto box = n.m_widget->clip;
glScissor(box.x, height - box.y - box.w, box.z, box.w);
n.m_widget->draw();
}
}
// for (auto& n : layout)
// {
//
// if (n.m_widget)
// {
// auto box = n.m_widget->clip;
// glScissor(box.x, height - box.y - box.w, box.z, box.w);
// n.m_widget->draw();
// }
// }
glDisable(GL_SCISSOR_TEST);
tex.unbind();
sampler.unbind();
@@ -142,7 +142,7 @@ void App::resize(float w, float h)
{
width = w;
height = h;
layout.update(width, height);
// layout.update(width, height);
}
void App::mouse_down(int button, float x, float y)