add wireframe paint option,
write file information on the screen, bug fixes
This commit is contained in:
@@ -127,7 +127,7 @@ void GeometryEngine::loadFile(QString filePath)
|
||||
}
|
||||
}
|
||||
|
||||
void GeometryEngine::drawGeometry(QOpenGLShaderProgram *program)
|
||||
void GeometryEngine::drawGeometry(QOpenGLShaderProgram *program, bool wireframe)
|
||||
{
|
||||
if (!m_arrayBuf.isCreated() || !m_indexBuf.isCreated())
|
||||
return;
|
||||
@@ -178,7 +178,7 @@ void GeometryEngine::drawGeometry(QOpenGLShaderProgram *program)
|
||||
bool tmp_transparent(false);
|
||||
|
||||
// bind the correct texture
|
||||
if (it.textureIndex < m_materials->size())
|
||||
if (it.textureIndex < m_materials->size() && m_materials->at(it.textureIndex).texture != Q_NULLPTR)
|
||||
{
|
||||
m_materials->at(it.textureIndex).texture->bind();
|
||||
tmp_transparent = m_materials->at(it.textureIndex).transparent;
|
||||
@@ -195,7 +195,7 @@ void GeometryEngine::drawGeometry(QOpenGLShaderProgram *program)
|
||||
program->setUniformValue("b_transparent", tmp_transparent);
|
||||
|
||||
// Draw cube geometry using indices from VBO 1
|
||||
glDrawElements(GL_TRIANGLES, it.size, GL_UNSIGNED_INT, (void*)(it.offset * sizeof(GLuint)));
|
||||
glDrawElements(wireframe? GL_LINES : GL_TRIANGLES, it.size, GL_UNSIGNED_INT, (void*)(it.offset * sizeof(GLuint)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user