read tx1d tx2d tx3d texture names and print to info window

This commit is contained in:
Anakin
2017-01-23 12:17:26 +01:00
parent 2ed9e475ce
commit b2df84eb4c
6 changed files with 89 additions and 29 deletions

View File

@@ -21,7 +21,7 @@ GeometryEngine::GeometryEngine(QObject *parent)
GeometryEngine::~GeometryEngine()
{
clearData();
delete m_defaultMaterial->texture;
delete m_defaultMaterial->texture0;
delete m_defaultMaterial;
}
@@ -39,7 +39,7 @@ void GeometryEngine::clearData()
if (m_materials != Q_NULLPTR)
{
for (auto it : *m_materials)
delete it.texture;
delete it.texture0;
m_materials->clear();
delete m_materials;
}
@@ -182,9 +182,9 @@ void GeometryEngine::drawGeometry(QOpenGLShaderProgram *program, bool wireframe)
QVector3D specularColor;
// bind the correct texture
if (it.textureIndex < m_materials->size() && m_materials->at(it.textureIndex).texture != Q_NULLPTR)
if (it.textureIndex < m_materials->size() && m_materials->at(it.textureIndex).texture0 != Q_NULLPTR)
{
m_materials->at(it.textureIndex).texture->bind();
m_materials->at(it.textureIndex).texture0->bind();
tmp_transparent = m_materials->at(it.textureIndex).transparent;
tmp_specular = m_materials->at(it.textureIndex).flags[7];
shininess = m_materials->at(it.textureIndex).shininess;
@@ -192,7 +192,7 @@ void GeometryEngine::drawGeometry(QOpenGLShaderProgram *program, bool wireframe)
}
else
{
m_defaultMaterial->texture->bind();
m_defaultMaterial->texture0->bind();
tmp_transparent = m_defaultMaterial->transparent;
}
// Set model matrix