Home -> ReadOnlyVertexAttribute

Declaration

class ReadOnlyVertexAttribute :public IVertexAttribute;

Description

The ReadOnlyVertexAttribute class represents a vertex attribute which has already been bound to a buffer and been populated with data, and only needs to be used from this point on but no longer needs to be modified. ReadOnlyVertexAttribute objects can only be initialized from an existing VertexAttribute or RawVertexAttribute object. The original attribute remains valid, and both are equivalent for use.

The intended purpose of the ReadOnlyVertexAttribute class is for ownership of an attribute to be transferred to another entity within the application, where there is no requirement to be able to modify or update the attribute, it simply needs to be bindable. This can be useful where attributes are aggregated into application-specific object types, and need to be able to be bound by the object type, but only the caller needs to be able to modify the data contained in the attributes.

Enumerations

Name Description
Public Enum DataType
Indicates the fundamental type of the data contained in this attribute
Public Enum PerformanceHint
Flags to provide hints to the graphics system about how the application will use this attribute. Correct use of performance hints allows the renderer to optimize the way the data is stored and modified to give the best performance.
Public Enum DataPersistenceFlags
Flags to provide hints to the graphics system about the required lifetime of data stored in this attribute. These flags can be used to reduce memory requirements or increase performance in some circumstances.

Members

Constructors

Name Description
Public member Constructor
Creates a ReadOnlyVertexAttribute object. The object is populated by calling BuildReadOnlyAttribute on an existing attribute.

Type methods

Name Description
Public member GetDataType
Returns the type of a single index entry
Public member GetVertexCount
Returns the number of vertices accessible through this vertex attribute
Public member GetAttributeElementCount
Returns the number of elements in the vector type set as the type of this vertex attribute
Public member GetDataTypeByteSize
Returns the size of a single vertex entry in bytes

Usage methods

Name Description
Public member GetPerformanceHintCpu
Returns the specified CPU performance hint for this vertex attribute
Public member GetPerformanceHintGpu
Returns the specified GPU performance hint for this vertex attribute
Public member GetDataPersistenceFlags
Returns the specified data persistence flags for this vertex attribute

Binding methods

Name Description
Public member IsBoundToBuffer
Reports whether this attribute has already been bound to a buffer
Public member BuildReadOnlyAttribute
Attempts to populate a ReadOnlyVertexAttribute from this attribute. Note that this attribute must already have been bound to a buffer for the call to succeed.

See also