Provides a data store for raw data to later be used as vertices or uniforms. 更多...
头: | #include <Qt3DRender/QBuffer> |
qmake: | QT += 3drender |
实例化: | Buffer |
继承: | Qt3DCore::QNode |
enum | AccessType { Write, Read, ReadWrite } |
enum | UsageType { StreamDraw, StreamRead, StreamCopy, StaticDraw, ..., DynamicCopy } |
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 |
void | setAccessType (Qt3DRender::QBuffer::AccessType access ) |
void | setSyncData (bool syncData ) |
void | setUsage (Qt3DRender::QBuffer::UsageType usage ) |
void | accessTypeChanged (Qt3DRender::QBuffer::AccessType access ) |
void | dataAvailable () |
void | dataChanged (const QByteArray & bytes ) |
void | syncDataChanged (bool syncData ) |
void | usageChanged (Qt3DRender::QBuffer::UsageType usage ) |
const QMetaObject | staticMetaObject |
typedef | QBufferDataGeneratorPtr |
Provides a data store for raw data to later be used as vertices or uniforms.
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.
常量 | 值 | 描述 |
---|---|---|
Qt3DRender::QBuffer::Write
|
0x1
|
Write access |
Qt3DRender::QBuffer::Read
|
0x2
|
Read access |
Qt3DRender::QBuffer::ReadWrite
|
Write|Read
|
Write|Read |
The type of the usage.
常量 | 值 | 描述 |
---|---|---|
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 |
返回 AccessType of the buffer.
访问函数:
Qt3DRender::QBuffer::AccessType | accessType () const |
void | setAccessType (Qt3DRender::QBuffer::AccessType access ) |
通知程序信号:
void | accessTypeChanged (Qt3DRender::QBuffer::AccessType access ) |
另请参阅 QBuffer::AccessType .
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.
访问函数:
bool | isSyncData () const |
void | setSyncData (bool syncData ) |
通知程序信号:
void | syncDataChanged (bool syncData ) |
Holds the buffer usage.
访问函数:
Qt3DRender::QBuffer::UsageType | usage () const |
void | setUsage (Qt3DRender::QBuffer::UsageType usage ) |
通知程序信号:
void | usageChanged (Qt3DRender::QBuffer::UsageType usage ) |
构造新的 QBuffer with parent .
Returns the data.
另请参阅 setData ().
[signal]
void
QBuffer::
dataAvailable
()
This signal is emitted when data becomes available.
[signal]
void
QBuffer::
dataChanged
(const
QByteArray
&
bytes
)
This signal is emitted with bytes when data changes.
Returns the buffer functor.
另请参阅 setDataGenerator ().
集 bytes as data.
另请参阅 data ().
Sets the buffer functor .
另请参阅 dataGenerator ().
Updates the data by replacing it with bytes at offset .
注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .