fixed wireframe bug

This commit is contained in:
Anakin 2017-01-16 16:41:52 +01:00
parent 47c73ed881
commit 91b3f25dbb
1 changed files with 6 additions and 1 deletions

View File

@ -195,7 +195,12 @@ void GeometryEngine::drawGeometry(QOpenGLShaderProgram *program, bool wireframe)
program->setUniformValue("b_transparent", tmp_transparent); program->setUniformValue("b_transparent", tmp_transparent);
// Draw cube geometry using indices from VBO 1 // 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);
} }
} }