diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2014-07-08 16:50:46 +0200 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2014-07-09 16:01:14 +0200 |
commit | 527c58e8f06a44ba12868ebeecc3bc4286462bc8 (patch) | |
tree | 2fb2d0c70ca4159c9e177c94036e9215fa853ef9 /src | |
parent | 3b7fee401190a4a1347d6cbbdd84d6f0a0f07234 (diff) |
QTorusMesh, QSphereMesh used default names for attributes
Change-Id: Ibbaddaf61f2774fc5ba62f8575ae9f37e01c3192
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/render/frontend/qspheremesh.cpp | 10 | ||||
-rw-r--r-- | src/render/frontend/qtorusmesh.cpp | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/render/frontend/qspheremesh.cpp b/src/render/frontend/qspheremesh.cpp index c69eba837..59b732a2b 100644 --- a/src/render/frontend/qspheremesh.cpp +++ b/src/render/frontend/qspheremesh.cpp @@ -198,17 +198,17 @@ MeshDataPtr QSphereMesh::createSphereMesh(double radius, int rings, int slices, buf->setUsage(QOpenGLBuffer::StaticDraw); buf->setData(bufferBytes); - mesh->addAttribute(QStringLiteral("position"), AttributePtr(new Attribute(buf, GL_FLOAT_VEC3, nVerts, 0, stride))); + mesh->addAttribute(QAbstractMeshData::defaultPositionAttributeName(), AttributePtr(new Attribute(buf, GL_FLOAT_VEC3, nVerts, 0, stride))); quint32 offset = sizeof(float) * 3; - mesh->addAttribute(QStringLiteral("texcoord"), AttributePtr(new Attribute(buf, GL_FLOAT_VEC2, nVerts, offset, stride))); + mesh->addAttribute(QAbstractMeshData::defaultTextureCoordinateAttributeName(), AttributePtr(new Attribute(buf, GL_FLOAT_VEC2, nVerts, offset, stride))); offset += sizeof(float) * 2; - mesh->addAttribute(QStringLiteral("normal"), AttributePtr(new Attribute(buf, GL_FLOAT_VEC3, nVerts, offset, stride))); + mesh->addAttribute(QAbstractMeshData::defaultNormalAttributeName(), AttributePtr(new Attribute(buf, GL_FLOAT_VEC3, nVerts, offset, stride))); offset += sizeof(float) * 3; if (hasTangents) { - mesh->addAttribute(QStringLiteral("tangent"), AttributePtr(new Attribute(buf, GL_FLOAT_VEC4, nVerts, offset, stride))); + mesh->addAttribute(QAbstractMeshData::defaultTangentAttributeName(), AttributePtr(new Attribute(buf, GL_FLOAT_VEC4, nVerts, offset, stride))); offset += sizeof(float) * 4; } @@ -266,7 +266,7 @@ MeshDataPtr QSphereMesh::createSphereMesh(double radius, int rings, int slices, indexBuffer->setData(indexBytes); mesh->setIndexAttribute(AttributePtr(new Attribute(indexBuffer, GL_UNSIGNED_SHORT, indices, 0, 0))); - mesh->computeBoundsFromAttribute(QStringLiteral("position")); + mesh->computeBoundsFromAttribute(QAbstractMeshData::defaultPositionAttributeName()); qCDebug(Render::Frontend) << "computed sphere bounds is:" << mesh->boundingBox(); return mesh; diff --git a/src/render/frontend/qtorusmesh.cpp b/src/render/frontend/qtorusmesh.cpp index 1dcdd15e4..823af9759 100644 --- a/src/render/frontend/qtorusmesh.cpp +++ b/src/render/frontend/qtorusmesh.cpp @@ -189,13 +189,13 @@ QAbstractMeshDataPtr QTorusMesh::createTorusMesh(double radius, double minorRadi buf->setUsage(QOpenGLBuffer::StaticDraw); buf->setData(bufferBytes); - mesh->addAttribute(QStringLiteral("position"), QAbstractAttributePtr(new Attribute(buf, GL_FLOAT_VEC3, nVerts, 0, stride))); + mesh->addAttribute(QAbstractMeshData::defaultPositionAttributeName(), QAbstractAttributePtr(new Attribute(buf, GL_FLOAT_VEC3, nVerts, 0, stride))); quint32 offset = sizeof(float) * 3; - mesh->addAttribute(QStringLiteral("texcoord"), QAbstractAttributePtr(new Attribute(buf, GL_FLOAT_VEC2, nVerts, offset, stride))); + mesh->addAttribute(QAbstractMeshData::defaultTextureCoordinateAttributeName(), QAbstractAttributePtr(new Attribute(buf, GL_FLOAT_VEC2, nVerts, offset, stride))); offset += sizeof(float) * 2; - mesh->addAttribute(QStringLiteral("normal"), QAbstractAttributePtr(new Attribute(buf, GL_FLOAT_VEC3, nVerts, offset, stride))); + mesh->addAttribute(QAbstractMeshData::defaultNormalAttributeName(), QAbstractAttributePtr(new Attribute(buf, GL_FLOAT_VEC3, nVerts, offset, stride))); offset += sizeof(float) * 3; QByteArray indexBytes; @@ -226,7 +226,7 @@ QAbstractMeshDataPtr QTorusMesh::createTorusMesh(double radius, double minorRadi indexBuffer->setData(indexBytes); mesh->setIndexAttribute(AttributePtr(new Attribute(indexBuffer, GL_UNSIGNED_SHORT, indices, 0, 0))); - mesh->computeBoundsFromAttribute(QStringLiteral("position")); + mesh->computeBoundsFromAttribute(QAbstractMeshData::defaultPositionAttributeName()); return mesh; } |