ref nodes work fine now but need to complete Widget::clone implementations and add clone() to Shape classes to actually clone the OpenGL data
This commit is contained in:
@@ -75,7 +75,7 @@ void App::init()
|
||||
#endif
|
||||
|
||||
layout.load("data/layout.xml");
|
||||
layout["main"].update(width, height);
|
||||
//layout["main"].update(width, height);
|
||||
|
||||
sampler.create();
|
||||
ShaderManager::create(kShader::Texture, shader_v, shader_f);
|
||||
@@ -127,13 +127,13 @@ void App::update(float dt)
|
||||
ShaderManager::u_int(kShaderUniform::Tex, 0);
|
||||
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
|
||||
//glEnable(GL_SCISSOR_TEST);
|
||||
glEnable(GL_SCISSOR_TEST);
|
||||
for (auto& n : layout[main_id])
|
||||
{
|
||||
if (n.m_widget)
|
||||
{
|
||||
auto box = n.m_widget->clip;
|
||||
glScissor(box.x, height - box.y - box.w, box.z, box.w);
|
||||
glScissor((int)box.x, (int)(height - box.y - box.w), (int)box.z, (int)box.w);
|
||||
n.m_widget->draw();
|
||||
}
|
||||
}
|
||||
@@ -145,6 +145,8 @@ void App::update(float dt)
|
||||
void App::resize(float w, float h)
|
||||
{
|
||||
constexpr auto main_id = const_hash("main");
|
||||
width = w;
|
||||
height = h;
|
||||
layout[main_id].update(w, h);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user