fixed backface culling bug,

todo: connect headligh
This commit is contained in:
Anakin
2017-01-30 00:02:32 +01:00
parent 538453c1db
commit fbb51563c9
5 changed files with 15 additions and 16 deletions

View File

@@ -51,7 +51,7 @@ void GeometryEngine::clearData()
m_drawList.clear();
}
void GeometryEngine::drawGeometry(QOpenGLShaderProgram *program, bool wireframe)
void GeometryEngine::drawGeometry(QOpenGLShaderProgram *program)
{
if (!m_arrayBuf.isCreated() || !m_indexBuf.isCreated())
return;
@@ -133,12 +133,8 @@ void GeometryEngine::drawGeometry(QOpenGLShaderProgram *program, bool wireframe)
program->setUniformValue("materialSpecularColor", specularColor);
// Draw cube geometry using indices from VBO 1
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);
}
}