Back with clickable button.

This commit is contained in:
James Grogan 2022-11-16 17:00:55 +00:00
parent 3e53bd9e00
commit 70891ce7b4
20 changed files with 107 additions and 50 deletions

View file

@ -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);
}

View file

@ -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;
}
}