QBuffer Class
(Qt3DRender::QBuffer)Provides a data store for raw data to later be used as vertices or uniforms. More...
| Header: | #include <Qt3DRender/QBuffer> |
| qmake: | QT += 3drender |
| Instantiated By: | Buffer |
| Inherits: | Qt3DCore::QNode |
Public Types
| enum | UsageType { StreamDraw, StreamRead, StreamCopy, StaticDraw, ..., DynamicCopy } |
Properties
- 3 properties inherited from Qt3DCore::QNode
- 1 property inherited from QObject
Public Functions
| QBuffer(Qt3DCore::QNode *parent = nullptr) | |
| Qt3DRender::QBuffer::AccessType | accessType() const |
| QByteArray | data() const |
| Qt3DRender::QBufferDataGeneratorPtr | dataGenerator() const |
| bool | isSyncData() const |
| void | setData(const QByteArray &bytes) |
| void | setDataGenerator(const Qt3DRender::QBufferDataGeneratorPtr &functor) |
| void | updateData(int offset, const QByteArray &bytes) |
| Qt3DRender::QBuffer::UsageType | usage() const |
- 13 public functions inherited from Qt3DCore::QNode
- 30 public functions inherited from QObject
Public Slots
| void | setAccessType(Qt3DRender::QBuffer::AccessType access) |
| void | setSyncData(bool syncData) |
| void | setUsage(Qt3DRender::QBuffer::UsageType usage) |
- 3 public slots inherited from Qt3DCore::QNode
- 1 public slot inherited from QObject
Signals
| void | accessTypeChanged(Qt3DRender::QBuffer::AccessType access) |
| void | dataChanged(const QByteArray &bytes) |
| void | syncDataChanged(bool syncData) |
| void | usageChanged(Qt3DRender::QBuffer::UsageType usage) |
- 4 signals inherited from Qt3DCore::QNode
- 2 signals inherited from QObject
Related Non-Members
| typedef | QBufferDataGeneratorPtr |
| typedef | QNodePtr |
| typedef | QNodeVector |
| typedef | QObjectList |
| QList<T> | qFindChildren(const QObject *obj, const QRegExp ®Exp) |
| Qt3DCore::QNodeId | qIdForNode(Qt3DCore::QNode *node) |
| Qt3DCore::QNodeIdVector | qIdsForNodes(const T &nodes) |
| T | qobject_cast(QObject *object) |
| T | qobject_cast(const QObject *object) |
Macros
| QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
| Q_CLASSINFO(Name, Value) | |
| Q_DISABLE_COPY(Class) | |
| Q_DISABLE_COPY_MOVE(Class) | |
| Q_DISABLE_MOVE(Class) | |
| Q_EMIT | |
| Q_ENUM(...) | |
| Q_ENUM_NS(...) | |
| Q_FLAG(...) | |
| Q_FLAG_NS(...) | |
| Q_GADGET | |
| Q_INTERFACES(...) | |
| Q_INVOKABLE | |
| Q_NAMESPACE | |
| Q_OBJECT | |
| Q_PROPERTY(...) | |
| Q_REVISION | |
| Q_SET_OBJECT_NAME(Object) | |
| Q_SIGNAL | |
| Q_SIGNALS | |
| Q_SLOT | |
| Q_SLOTS |
Additional Inherited Members
- 9 static public members inherited from QObject
- 2 protected functions inherited from Qt3DCore::QNode
- 9 protected functions inherited from QObject
Detailed Description
Data can either be provided directly using QBuffer::setData() or by specifying a generator with QBuffer::setDataGenerator() and providing a Qt3DRender::QBufferDataGeneratorPtr.
When using a generator the data will be loaded asynchronously in a job. The loaded data can be read back if the QBuffer::syncData flag is set to true.
Member Type Documentation
enum QBuffer::UsageType
The type of the usage.
| Constant | Value | Description |
|---|---|---|
Qt3DRender::QBuffer::StreamDraw | 0x88E0 | GL_STREAM_DRAW |
Qt3DRender::QBuffer::StreamRead | 0x88E1 | GL_STREAM_READ |
Qt3DRender::QBuffer::StreamCopy | 0x88E2 | GL_STREAM_COPY |
Qt3DRender::QBuffer::StaticDraw | 0x88E4 | GL_STATIC_DRAW |
Qt3DRender::QBuffer::StaticRead | 0x88E5 | GL_STATIC_READ |
Qt3DRender::QBuffer::StaticCopy | 0x88E6 | GL_STATIC_COPY |
Qt3DRender::QBuffer::DynamicDraw | 0x88E8 | GL_DYNAMIC_DRAW |
Qt3DRender::QBuffer::DynamicRead | 0x88E9 | GL_DYNAMIC_READ |
Qt3DRender::QBuffer::DynamicCopy | 0x88EA | GL_DYNAMIC_COPY |
Property Documentation
syncData : bool
Holds the syncData flag. When syncData is true, this will force data created by a Qt3DRender::QBufferDataGenerator to also be updated on the frontend Qt3DRender::QBuffer node. By default syncData is false.
Note: : This has no effect if the buffer's data was set directly using the data property.
Access functions:
| bool | isSyncData() const |
| void | setSyncData(bool syncData) |
Notifier signal:
| void | syncDataChanged(bool syncData) |
usage : UsageType
Holds the buffer usage.
Access functions:
| Qt3DRender::QBuffer::UsageType | usage() const |
| void | setUsage(Qt3DRender::QBuffer::UsageType usage) |
Notifier signal:
| void | usageChanged(Qt3DRender::QBuffer::UsageType usage) |
Member Function Documentation
QBuffer::QBuffer(Qt3DCore::QNode *parent = nullptr)
Constructs a new QBuffer with parent.
[signal] void QBuffer::dataChanged(const QByteArray &bytes)
This signal is emitted with bytes when data changes.
QByteArray QBuffer::data() const
Returns the data.
See also setData().
Qt3DRender::QBufferDataGeneratorPtr QBuffer::dataGenerator() const
Returns the buffer functor.
See also setDataGenerator().
void QBuffer::setData(const QByteArray &bytes)
Sets bytes as data.
See also data().
void QBuffer::setDataGenerator(const Qt3DRender::QBufferDataGeneratorPtr &functor)
Sets the buffer functor.
See also dataGenerator().
void QBuffer::updateData(int offset, const QByteArray &bytes)
Updates the data by replacing it with bytes at offset.
Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.