mirror of https://github.com/qt/qtdatavis3d.git
Fix crash when adding a texture on QML
When texture was attached on the qmlsurface example, the smoothUVs was called before the actual model mesh was created. Change-Id: I5a62b06291232df54ce08d586d8794b332a4eece Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
This commit is contained in:
parent
cf47756e17
commit
6939d7e10a
|
|
@ -325,12 +325,14 @@ void SurfaceObject::smoothUVs(const QSurfaceDataArray &dataArray,
|
|||
}
|
||||
}
|
||||
|
||||
glBindBuffer(GL_ARRAY_BUFFER, m_uvTextureBuffer);
|
||||
glBufferData(GL_ARRAY_BUFFER, uvs.size() * sizeof(QVector2D),
|
||||
&uvs.at(0), GL_STATIC_DRAW);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
if (uvs.size() > 0) {
|
||||
glBindBuffer(GL_ARRAY_BUFFER, m_uvTextureBuffer);
|
||||
glBufferData(GL_ARRAY_BUFFER, uvs.size() * sizeof(QVector2D),
|
||||
&uvs.at(0), GL_STATIC_DRAW);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
|
||||
m_returnTextureBuffer = true;
|
||||
m_returnTextureBuffer = true;
|
||||
}
|
||||
}
|
||||
|
||||
void SurfaceObject::updateSmoothRow(const QSurfaceDataArray &dataArray, int rowIndex, bool polar)
|
||||
|
|
|
|||
Loading…
Reference in New Issue