summaryrefslogtreecommitdiffstats
path: root/src/render/io/gltfparser.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2015-01-23 16:22:00 +0100
committerSean Harmer <sean.harmer@kdab.com>2015-08-07 00:11:31 +0000
commitc2f6f37699296557c5d79ae750e0ce91647de2ee (patch)
tree6c140186656c46d5e8584d48772f70e78d04806c /src/render/io/gltfparser.cpp
parentce69c98f6954ef2c8806bc44a457a58e4202d751 (diff)
New Buffer API Frontend Classes
- Switch QAbstractAttribute and QAbstractBuffer to QNode subclasses - Get rid of all shared pointer when dealing with these (needed to expose to QML and use the QObject ownership) - Introduce QGeometryRender, QGeometry, QAttributeProvider, QAttributeAggregator. A QMesh component now is: a QGeometryRenderer which specifies its QGeometry. The QGeometry refererences n attributes. Each attribute references a QAbstractBuffer. Change-Id: I49a10c11a605e5fe7c180af86a404f622e763f48 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/io/gltfparser.cpp')
-rw-r--r--src/render/io/gltfparser.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/render/io/gltfparser.cpp b/src/render/io/gltfparser.cpp
index 0cff55016..1baaf1712 100644
--- a/src/render/io/gltfparser.cpp
+++ b/src/render/io/gltfparser.cpp
@@ -625,11 +625,11 @@ void GLTFParser::processJSONBufferView( QString id, const QJsonObject& json )
}
int target = json.value(KEY_TARGET).toInt();
- QOpenGLBuffer::Type ty(QOpenGLBuffer::VertexBuffer);
+ QBuffer::BufferType ty(QBuffer::VertexBuffer);
switch (target) {
- case GL_ARRAY_BUFFER: ty = QOpenGLBuffer::VertexBuffer; break;
- case GL_ELEMENT_ARRAY_BUFFER: ty = QOpenGLBuffer::IndexBuffer; break;
+ case GL_ARRAY_BUFFER: ty = QBuffer::VertexBuffer; break;
+ case GL_ELEMENT_ARRAY_BUFFER: ty = QBuffer::IndexBuffer; break;
default:
qWarning() << Q_FUNC_INFO << "buffer" << id << "unsupported target:" << target;
return;
@@ -654,7 +654,7 @@ void GLTFParser::processJSONBufferView( QString id, const QJsonObject& json )
}
delete f;
- BufferPtr b(new Buffer(ty));
+ QBuffer *b(new QBuffer(ty));
b->setData(bytes);
m_buffers[id] = b;
}
@@ -667,7 +667,7 @@ void GLTFParser::processJSONAccessor( QString id, const QJsonObject& json )
return;
}
- BufferPtr buf = m_buffers.value(bvName);
+ QBuffer *buf = m_buffers.value(bvName);
int offset = 0, stride = 0;
int type = json.value(KEY_TYPE).toInt();
int count = json.value(KEY_COUNT).toInt();
@@ -677,7 +677,7 @@ void GLTFParser::processJSONAccessor( QString id, const QJsonObject& json )
if ( json.contains(KEY_BYTE_STRIDE))
stride = json.value(KEY_BYTE_STRIDE).toInt();
- AttributePtr attr( new Attribute( buf, type, count, offset, stride ) );
+ QAttribute *attr( new QAttribute( buf, type, count, offset, stride ) );
m_attributeDict[id] = attr;
}