Home -> RawIndexAttribute

Declaration

class RawIndexAttribute : public IIndexAttribute;

Description

The RawIndexAttribute 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.

The RawIndexAttribute class is similar to IndexAttribute, however unlike IndexAttribute this class is not templated, and provides no compile-time type safety to ensure it is used with arguments of the correct type, nor does it ensure that type characteristics such as stride are correctly determined by default. For this reason, it is recommended to use the IndexAttribute class where possible. The RawIndexAttribute class is intended more for use behind higher level support libraries, where aspects such as type safety have already been handled for the application programmer by those libraries, and a simple attribute type is desired to forward already validated information to the renderer.

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
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 RawIndexAttribute object. Note that the type itself is immutable, and all state is passed into the constructor.

Type methods

Name Description
Public member GetDataType
Returns the type of a single index entry
Public member GetIndexCount
Returns the number of indices accessible through this index attribute
Public member GetDataTypeByteSize
Returns the size of a single index in bytes

Usage methods

Name Description
Public member GetPerformanceHintCpu
Returns the specified CPU performance hint for this index attribute
Public member GetPerformanceHintGpu
Returns the specified GPU performance hint for this index attribute
Public member GetDataPersistenceFlags
Returns the specified data persistence flags for this index 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 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
Public member 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.
Public member QueueDataUpdate
Updates data in the associated buffer. Unlike the SetInitialData method, the provided memory can be modified or deallocated immediately after this method returns.

See also