QBuffer 类

( Qt3DRender::QBuffer )

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 BufferType { VertexBuffer, IndexBuffer, PixelPackBuffer, PixelUnpackBuffer, ..., DrawIndirectBuffer }
enum UsageType { StreamDraw, StreamRead, StreamCopy, StaticDraw, ..., DynamicCopy }

特性

公共函数

QBuffer (BufferType ty = QBuffer::VertexBuffer, Qt3DCore::QNode * parent = nullptr)
AccessType accessType () const
QByteArray data () const
QBufferDataGeneratorPtr dataGenerator () const
bool isSyncData () const
void setData (const QByteArray & bytes )
void setDataGenerator (const QBufferDataGeneratorPtr & functor )
BufferType type () const
void updateData (int offset , const QByteArray & bytes )
UsageType usage () const

公共槽

void setAccessType (AccessType access )
void setSyncData (bool syncData )
void setType (BufferType type )
void setUsage (UsageType usage )

信号

void accessTypeChanged (AccessType access )
void dataAvailable ()
void dataChanged (const QByteArray & bytes )
void syncDataChanged (bool syncData )
void typeChanged (BufferType type )
void usageChanged (UsageType usage )
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.

成员类型文档编制

enum QBuffer:: AccessType

enum QBuffer:: BufferType

The type of the buffer.

常量 描述
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

enum QBuffer:: UsageType

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 : AccessType

访问函数:

AccessType accessType () const
void setAccessType (AccessType access )

通知程序信号:

void accessTypeChanged (AccessType access )

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.

访问函数:

bool isSyncData () const
void setSyncData (bool syncData )

通知程序信号:

void syncDataChanged (bool syncData )

type : BufferType

Holds the buffer type.

访问函数:

BufferType type () const
void setType (BufferType type )

通知程序信号:

void typeChanged (BufferType type )

usage : UsageType

Holds the buffer usage.

访问函数:

UsageType usage () const
void setUsage (UsageType usage )

通知程序信号:

void usageChanged (UsageType usage )

成员函数文档编制

QBuffer:: QBuffer ( BufferType ty = QBuffer::VertexBuffer, Qt3DCore::QNode * parent = nullptr)

Default constructs an instance of QBuffer.

QByteArray QBuffer:: data () const

Returns the data.

另请参阅 setData ().

[signal] void QBuffer:: dataAvailable ()

[signal] void QBuffer:: dataChanged (const QByteArray & bytes )

This signal is emitted with bytes when data changes.

QBufferDataGeneratorPtr QBuffer:: dataGenerator () const

Returns the buffer functor.

另请参阅 setDataGenerator ().

void QBuffer:: setData (const QByteArray & bytes )

bytes as data.

另请参阅 data ().

void QBuffer:: setDataGenerator (const QBufferDataGeneratorPtr & functor )

Sets the buffer functor .

另请参阅 dataGenerator ().

void QBuffer:: updateData ( int offset , const QByteArray & bytes )

Updates the data by replacing it with bytes at offset .

相关非成员

typedef Qt3DRender:: QBufferDataGeneratorPtr