Back with clickable button.
This commit is contained in:
parent
3e53bd9e00
commit
70891ce7b4
20 changed files with 107 additions and 50 deletions
|
@ -65,7 +65,7 @@ void OpenGlMeshPainter::paint(const std::vector<float>& verts, const std::vector
|
|||
int vertexColorLocation = glGetUniformLocation(mShaderProgram->getHandle(), "ourColor");
|
||||
glUniform4f(vertexColorLocation, float(color[0]), float(color[1]), float(color[2]), float(color[3]));
|
||||
|
||||
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
//glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
|
||||
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0);
|
||||
glBindVertexArray(0);
|
||||
}
|
||||
|
|
|
@ -54,17 +54,17 @@ void OpenGlPainter::paint(DrawingContext* context)
|
|||
glClearColor(0.5, 0.5, 1.0, 0.0);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
for(unsigned idx=0; idx<context->getSurface()->getScene()->getNumItems(); idx++)
|
||||
auto scene = context->getSurface()->getScene();
|
||||
for(unsigned idx=0; idx<scene->getNumItems(); idx++)
|
||||
{
|
||||
auto scene_item = context->getSurface()->getScene()->getItem(idx);
|
||||
auto scene_item = scene->getItem(idx);
|
||||
if (scene_item->getType() == SceneItem::Type::MODEL)
|
||||
{
|
||||
mMeshPainter->paint(dynamic_cast<SceneModel*>(scene_item), context);
|
||||
}
|
||||
else
|
||||
else if (scene_item->getType() == SceneItem::Type::TEXT)
|
||||
{
|
||||
mTextPainter->paint(dynamic_cast<SceneText*>(scene_item), context);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue