QBuffer Class▲
-
Header: Qt3DRender/QBuffer
-
Since: Qt 5.7
-
qmake: QT += 3drender
-
Inherited By:
-
Instantiated By: qml-qt3d-render-buffer.xml
-
Inherits: Qt3DCore::QNode
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::AccessType▲
Constant |
Value |
Description |
---|---|---|
Qt3DRender::QBuffer::Write |
0x1 |
Write access |
Qt3DRender::QBuffer::Read |
0x2 |
Read access |
Qt3DRender::QBuffer::ReadWrite |
Write|Read |
Write|Read |
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▲
accessType : AccessType▲
Returns the AccessType of the buffer.
Access functions:
-
accessType() const
-
void setAccessType( access)
Notifier signal:
-
void accessTypeChanged( access)
See Also▲
See also QBuffer::AccessType
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.
: 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:
-
usage() const
-
void setUsage( usage)
Notifier signal:
-
void usageChanged( usage)
Member Function Documentation▲
[explicit] QBuffer::QBuffer(Qt3DCore::QNode *parent = nullptr)▲
Constructs a new QBuffer with parent.
QByteArray QBuffer::data() const▲
void QBuffer::dataAvailable()▲
This signal is emitted when data becomes available.
void QBuffer::dataChanged(const QByteArray &bytes)▲
This signal is emitted with bytes when data changes.
Qt3DRender::QBufferDataGeneratorPtr QBuffer::dataGenerator() const▲
void QBuffer::setData(const QByteArray &bytes)▲
void QBuffer::setDataGenerator(const Qt3DRender::QBufferDataGeneratorPtr &functor)▲
void QBuffer::updateData(int offset, const QByteArray &bytes)▲
Updates the data by replacing it with bytes at offset.
Related Non-Members▲
Obsolete Members for QBuffer▲
The following members of class QBuffer are deprecated. We strongly advise against using them in new code.
Obsolete Member Type Documentation▲
enum QBuffer::BufferType▲
This enum is deprecated. We strongly advise against using it in new code.
The type of the buffer.
Constant |
Value |
Description |
---|---|---|
Qt3DRender::QBuffer::VertexBuffer |
0x8892 |
GL_ARRAY_BUFFER |
Qt3DRender::QBuffer::IndexBuffer |
0x8893 |
GL_ELEMENT_ARRAY_BUFFER |
Qt3DRender::QBuffer::PixelPackBuffer |
0x88EB |
GL_PIXEL_PACK_BUFFER |
Qt3DRender::QBuffer::PixelUnpackBuffer |
0x88EC |
GL_PIXEL_UNPACK_BUFFER |
Qt3DRender::QBuffer::UniformBuffer |
0x8A11 |
GL_UNIFORM_BUFFER |
Qt3DRender::QBuffer::ShaderStorageBuffer |
0x90D2 |
GL_SHADER_STORAGE_BUFFER |
Qt3DRender::QBuffer::DrawIndirectBuffer |
0x8F3F |
GL_DRAW_INDIRECT_BUFFER |
Obsolete Property Documentation▲
type : BufferType▲
This property is deprecated. We strongly advise against using it in new code.
Holds the buffer type.
Access functions:
-
type() const
-
void setType( type)
Notifier signal:
-
void typeChanged( type)