diff --git a/QtMeshViewer/Source/GeometryEngine.cpp b/QtMeshViewer/Source/GeometryEngine.cpp index 55112d9..c752d24 100644 --- a/QtMeshViewer/Source/GeometryEngine.cpp +++ b/QtMeshViewer/Source/GeometryEngine.cpp @@ -195,7 +195,12 @@ void GeometryEngine::drawGeometry(QOpenGLShaderProgram *program, bool wireframe) program->setUniformValue("b_transparent", tmp_transparent); // Draw cube geometry using indices from VBO 1 - glDrawElements(wireframe? GL_LINES : GL_TRIANGLES, it.size, GL_UNSIGNED_INT, (void*)(it.offset * sizeof(GLuint))); + if(wireframe) + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + + glDrawElements(GL_TRIANGLES, it.size, GL_UNSIGNED_INT, (void*)(it.offset * sizeof(GLuint))); + + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); } }