MTXPop

C Specification

#include <revolution/mtx.h>
MtxPtr MTXPop ( MtxStack* sPtr );

Arguments

sPtr Pointer to a MtxStack structure whose member stackPtr is to be decreased.

Return Values

Returns the new stack pointer (old stack pointer - MTX_PTR_OFFSET) if the old stack pointer was greater than stack base;
otherwise, returns NULL (empty stack).

Description

Decreases sPtr's member stackPtr by one matrix (sPtr->stackPtr -= MTX_PTR_OFFSET), in effect popping it from the stack. The popped matrix's memory is untouched until overwritten by a 'push' call.

If the stack pointer was equal to the stack base, sPtr->stackPtr is set to NULL, indicating an empty stack.

See Also

Mtx, MtxPtr, MtxStack, MtxStackPtr, MTXGetStackPtr, MTXPush, MTXPushFwd, MTXPushInv, MTXPushInvXpose

Revision History

03/01/2006 Initial version.