本页内容

QSGGeometry::Attribute Struct

struct QSGGeometry::Attribute

QSGGeometry::Attribute 描述了QSGGeometry 中的单个顶点属性。更多内容...

静态公共成员

QSGGeometry::Attribute create(int pos, int tupleSize, int primitiveType, bool isPosition = false)
QSGGeometry::Attribute createWithAttributeType(int pos, int tupleSize, int primitiveType, QSGGeometry::AttributeType attributeType)

详细描述

QSGGeometry::Attribute 结构体描述了属性寄存器位置、属性元组的大小以及属性类型。

它还包含一个提示,用于告知渲染器该属性是否是描述位置的属性。场景图渲染器可以使用此信息进行优化。

它包含一些保留位,供将来使用。

另请参见 QSGGeometry 。

成员函数文档

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

为属性寄存器pos 创建一个新的QSGGeometry::Attribute ,其tupleSize 为 。primitiveType 可以是QSGGeometry::Type 中支持的任何类型,例如QSGGeometry::FloatType 或QSGGeometry::UnsignedByteType 。

如果该属性描述的是顶点的位置,则应将isPosition 提示设置为true 。场景图渲染器可能会利用此信息进行优化。

请使用 create 函数来构建该属性,而非初始化列表,以确保所有字段均已初始化。

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

为属性注册表pos 创建一个新的QSGGeometry::Attribute ,其tupleSize 。primitiveType 可以是QSGGeometry::Type 中支持的任何类型,例如QSGGeometry::FloatType 或QSGGeometry::UnsignedByteType 。

attributeType 描述该属性的预期用途。

请使用 create 函数来构建该属性,而非初始化列表,以确保所有字段均已初始化。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.