Home -> IndexAttribute
Declaration
template<class T>
class IndexAttribute :public IIndexAttribute;Description
The IndexAttribute class defines an index attribute, used to provide indices to an IRenderableNode object during drawing. In order to use an index attribute, it must first be added to an IIndexBuffer, which then needs to be allocated. Once the attached buffer has been allocated, the index attribute can then be bound to any number of IRenderableNode objects.
This class a templated type. The template argument specifies the data type of the contained indices. Only two types are supported, which is V1UInt16 for 16-bit indices, and V1UInt32 for 32-bit indices. Attempting to create an instance of this class with any other type argument will generate a compilation error.
Unlike most other types in this API, the IndexAttribute class is a concrete type that is directly created by the application, and passed into the API. Internally, this class derives from the IIndexAttribute interface, which allows the class implementation to be fully separated over pure virtual interfaces from the renderers.
Enumerations
| Name | Description | |
|---|---|---|
| DataType |
Indicates the fundamental type of the data contained in this attribute
|
|
| 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.
|
|
| 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 | |
|---|---|---|
| Constructor |
Creates an IndexAttribute object. Note that the type itself is immutable, and all state is passed into the constructor.
|
Type methods
| Name | Description | |
|---|---|---|
| GetDataType |
Returns the type of a single index entry
|
|
| GetIndexCount |
Returns the number of indices accessible through this index attribute
|
|
| GetDataTypeByteSize |
Returns the size of a single index in bytes
|
|
|
|
GetPrimitiveRestartValue |
Returns the index value used to represent a primitive restart for the instantiated type
|
Usage methods
| Name | Description | |
|---|---|---|
| GetPerformanceHintCpu |
Returns the specified CPU performance hint for this index attribute
|
|
| GetPerformanceHintGpu |
Returns the specified GPU performance hint for this index attribute
|
|
| GetDataPersistenceFlags |
Returns the specified data persistence flags for this index attribute
|
Binding methods
| Name | Description | |
|---|---|---|
| IsBoundToBuffer |
Reports whether this attribute has already been bound to a buffer
|
|
| BuildReadOnlyAttribute |
Attempts to populate a ReadOnlyIndexAttribute
from this attribute. Note that this attribute must already have been bound to a buffer for the call to
succeed.
|
Data methods
| Name | Description | |
|---|---|---|
| SetInitialData |
Supplies initial data to use when allocating the buffer this attribute is assigned to. Note that the supplied
memory must remain valid and accessible until the AllocateMemory
method is called.
|
|
| QueueDataUpdate |
Updates data in the associated buffer. Unlike the SetInitialData method, the provided
memory can be modified or deallocated immediately after this method returns.
|