MtxStack, MtxStackPtr

Syntax

#include <revolution/mtx.h>

typedef struct
{

    u32    numMtx;
    MtxPtr stackBase;
    MtxPtr stackPtr;

} MtxStack, *MtxStackPtr;

Arguments

None.

Return Values

None.

Description

MtxStack is used to contain a dynamically allocated array of matrices (type Mtx). Used in conjunction with a set of stack management routines, MtxStack provides the MTX library with an API to create and manage a stack of 3x4 matrices.

The numMtx field is used to record the number of matrices in the MtxStack's Mtx array.

stackBase is a pointer to the Mtx array's base. When a MtxStack structure is first declared, stackBase has no memory allocated to it. The MTXAllocStack macro must be called to allocate memory to stackBase. This reserves numMtx * sizeof(Mtx) bytes.

Use stackPtr to keep track of the current 'top of stack' matrix. This is adjusted in whole-matrix increments.

MtxStackPtr is a pointer to a MtxStack structure.
Note: It points to the structure itself, and not directly to the stack's matrix memory.

See Also

Mtx, MtxPtr, MTXAllocStack, MTXFreeStack, MTXGetStackPtr, MTXInitStack, MTXPop, MTXPush, MTXPushFwd, MTXPushInv, MTXPushInvXpose, OSAlloc, OSFree

Revision History

2006/03/01 Initial version.


CONFIDENTIAL