GXMatrixIndex

Syntax

#include <revolution/gx.h>

void GXMatrixIndex1u8 ( u8  index );
void GXMatrixIndex1x8 ( u8  index );

Arguments

index Unsigned, eight-bit index to matrix memory. This number represents the first row of matrix memory where the matrix is loaded.

Return Values

None.

Description

This function is used to specify matrix index data for a vertex. It can be called only between the GXBegin function and the GXEnd function. The matrix index specifies which matrix (previously loaded into matrix memory, see the GXLoadPosMtxImm, GXLoadNrmMtxImm, and GXLoadTexMtxImm functions for similar matrices) to use to transform this vertex's data.

To use this function for a vertex, you must enable a matrix index in the current vertex descriptor. The current vertex descriptor is set using the GXSetVtxDesc function. There is no need to set a vertex attribute format (GXSetVtxAttrFmt) because the index must be an unsigned eight-bit number. Both the GXMatrixIndex1u8 and GXMatrixIndex1x8 functions are the same.

The order in which vertex functions must be called is specified in the GXSetVtxDesc function. Each vertex must send attributes (position coordinates, colors, normals, and so forth) in the specified order to guarantee proper parsing by the graphics hardware.

The GXMatrixIndex1u8 (GXMatrixIndex1x8) function is implemented as an inline function in the non-debug version of the GX library for optimal performance. The GXMatrixIndex1u8(GXMatrixIndex1x8) is implemented as a regular function in the debug version of the GX library so the library can verify the correct order of vertex function calls between GXBegin/GXEnd (a common source of errors).

See Also

GXBegin, GXEnd, GXSetVtxDesc, GXSetVtxAttrFmt

Revision History

2006/03/01 Initial version.


CONFIDENTIAL