Attribute 類

( QSGGeometry::Attribute )

The QSGGeometry::Attribute describes a single vertex attribute in a QSGGeometry 更多...

頭: #include <Attribute>
qmake: QT += quick

靜態公共成員

屬性 create (int pos , int tupleSize , int primitiveType , bool isPosition = false)
屬性 createWithAttributeType (int pos , int tupleSize , int primitiveType , AttributeType attributeType )

詳細描述

The QSGGeometry::Attribute describes a single vertex attribute in a QSGGeometry

The QSGGeometry::Attribute struct describes the attribute register position, the size of the attribute tuple and the attribute type.

It also contains a hint to the renderer if this attribute is the attribute describing the position. The scene graph renderer may use this information to perform optimizations.

It contains a number of bits which are reserved for future use.

另請參閱 QSGGeometry .

成員函數文檔編製

[static] Attribute Attribute:: create ( int pos , int tupleSize , int primitiveType , bool isPosition = false)

創建新的 QSGGeometry::Attribute for attribute register pos with tupleSize primitiveType can be any of the supported types from QSGGeometry::Type ,譬如 QSGGeometry::FloatType or QSGGeometry::UnsignedByteType .

If the attribute describes the position for the vertex, the isPosition hint should be set to true . The scene graph renderer may use this information to perform optimizations.

注意: Scene graph backends for APIs other than OpenGL may require an accurate description of attributes' usage, and therefore it is recommended to use createWithAttributeType () 代替。

Use the create function to construct the attribute, rather than an initialization list, to ensure that all fields are initialized.

[static] Attribute Attribute:: createWithAttributeType ( int pos , int tupleSize , int primitiveType , AttributeType attributeType )

創建新的 QSGGeometry::Attribute for attribute register pos with tupleSize primitiveType can be any of the supported types from QSGGeometry::Type ,譬如 QSGGeometry::FloatType or QSGGeometry::UnsignedByteType .

attributeType describes the intended use of the attribute.

Use the create function to construct the attribute, rather than an initialization list, to ensure that all fields are initialized.