Provides a data store for raw data to later be used as vertices or uniforms. 更多...
头: | #include <Qt3DCore/QBuffer> |
CMake: |
find_package(Qt6 REQUIRED COMPONENTS 3dcore)
target_link_libraries(mytarget PRIVATE Qt6::3dcore) |
qmake: | QT += 3dcore |
实例化: | Buffer |
继承: | Qt3DCore::QNode |
enum | AccessType { Write, Read, ReadWrite } |
enum | UsageType { StreamDraw, StreamRead, StreamCopy, StaticDraw, StaticRead, …, DynamicCopy } |
QBuffer (Qt3DCore::QNode * parent = nullptr) | |
Qt3DCore::QBuffer::AccessType | accessType () const |
QByteArray | data () const |
void | setData (const QByteArray & bytes ) |
void | updateData (int offset , const QByteArray & bytes ) |
Qt3DCore::QBuffer::UsageType | usage () const |
void | setAccessType (Qt3DCore::QBuffer::AccessType access ) |
void | setUsage (Qt3DCore::QBuffer::UsageType usage ) |
void | accessTypeChanged (Qt3DCore::QBuffer::AccessType access ) |
void | dataAvailable () |
void | dataChanged (const QByteArray & bytes ) |
void | usageChanged (Qt3DCore::QBuffer::UsageType usage ) |
Data can be provided directly using QBuffer::setData ().
常量 | 值 | 描述 |
---|---|---|
Qt3DCore::QBuffer::Write
|
0x1
|
Write access |
Qt3DCore::QBuffer::Read
|
0x2
|
Read access |
Qt3DCore::QBuffer::ReadWrite
|
Write|Read
|
Write|Read |
The type of the usage.
常量 | 值 | 描述 |
---|---|---|
Qt3DCore::QBuffer::StreamDraw
|
0x88E0
|
GL_STREAM_DRAW |
Qt3DCore::QBuffer::StreamRead
|
0x88E1
|
GL_STREAM_READ |
Qt3DCore::QBuffer::StreamCopy
|
0x88E2
|
GL_STREAM_COPY |
Qt3DCore::QBuffer::StaticDraw
|
0x88E4
|
GL_STATIC_DRAW |
Qt3DCore::QBuffer::StaticRead
|
0x88E5
|
GL_STATIC_READ |
Qt3DCore::QBuffer::StaticCopy
|
0x88E6
|
GL_STATIC_COPY |
Qt3DCore::QBuffer::DynamicDraw
|
0x88E8
|
GL_DYNAMIC_DRAW |
Qt3DCore::QBuffer::DynamicRead
|
0x88E9
|
GL_DYNAMIC_READ |
Qt3DCore::QBuffer::DynamicCopy
|
0x88EA
|
GL_DYNAMIC_COPY |
返回 AccessType of the buffer.
访问函数:
Qt3DCore::QBuffer::AccessType | accessType () const |
void | setAccessType (Qt3DCore::QBuffer::AccessType access ) |
通知程序信号:
void | accessTypeChanged (Qt3DCore::QBuffer::AccessType access ) |
另请参阅 QBuffer::AccessType .
Holds the buffer usage.
访问函数:
Qt3DCore::QBuffer::UsageType | usage () const |
void | setUsage (Qt3DCore::QBuffer::UsageType usage ) |
通知程序信号:
void | usageChanged (Qt3DCore::QBuffer::UsageType usage ) |
[explicit]
QBuffer::
QBuffer
(
Qt3DCore::QNode
*
parent
= nullptr)
Constructs a new 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.
设置 bytes as data.
另请参阅 data ().
[invokable]
void
QBuffer::
updateData
(
int
offset
, const
QByteArray
&
bytes
)
Updates the data by replacing it with bytes at offset .
注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .