1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="Microsoft FrontPage 5.0"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 8<TITLE>MtxStack, MtxStackPtr</TITLE> 9</HEAD> 10<BODY> 11<H1>MtxStack, MtxStackPtr</H1> 12 13<H2>Syntax</H2> 14<dl><dd><pre class="construction"> 15#include <revolution/mtx.h> 16 17typedef struct 18{ 19 20 u32 numMtx; 21 MtxPtr stackBase; 22 MtxPtr stackPtr; 23 24} MtxStack, *MtxStackPtr; 25</pre></dd></dl> 26 27<H2>Arguments</H2> 28<P>None.</P> 29 30<H2>Return Values</H2> 31<P>None.</P> 32 33<H2>Description</H2> 34<P><strong><code>MtxStack</code></strong> is used to contain a dynamically allocated array of matrices (type <a href="Mtx_MtxPtr.html"><code>Mtx</code></a>). Used in conjunction with a set of stack management routines, <STRONG>MtxStack</STRONG> provides the <code>MTX</code> library with an API to create and manage a stack of 3x4 matrices.</P> 35<P>The <code><em><strong>numMtx</strong></em></code> field is used to record the number of matrices in the <code><strong>MtxStack</strong></code>'s <a href="Mtx_MtxPtr.html"><code>Mtx</code></a> array.</P> 36<P><code><em><strong>stackBase</strong></em></code> is a pointer to the <a href="Mtx_MtxPtr.html"><code>Mtx</code></a> array's base. When a <code><strong>MtxStack</strong></code> structure is first declared, <code><em><strong>stackBase</strong></em></code> has no memory allocated to it. The <code>MTXAllocStack</code> macro must be called to allocate memory to <SPAN class="argument">stackBase</SPAN>. This reserves <SPAN class="argument">numMtx</SPAN> * <CODE>sizeof(<A href="Mtx_MtxPtr.html">Mtx</A>)</CODE> bytes.</P> 37<P>Use <code><em><strong>stackPtr</strong></em></code> to keep track of the current 'top of stack' matrix. This is adjusted in whole-matrix increments.</P> 38<P><code><strong>MtxStackPtr</strong></code> is a pointer to a <code><strong>MtxStack</strong></code> structure. <BR><B>Note:</B> It points to the structure itself, and not directly to the stack's matrix memory.</P> 39 40<H2>See Also</H2> 41<P class="reference"> 42<A href="Mtx_MtxPtr.html">Mtx, MtxPtr</A>, 43<A href="../stack/MTXAllocStack.html">MTXAllocStack</A>, 44<A href="../stack/MTXFreeStack.html">MTXFreeStack</A>, 45<A href="../stack/MTXGetStackPtr.html">MTXGetStackPtr</A>, 46<A href="../stack/MTXInitStack.html">MTXInitStack</A>, 47<A href="../stack/MTXPop.html">MTXPop</A>, 48<A href="../stack/MTXPush.html">MTXPush</A>, 49<A href="../stack/MTXPushFwd.html">MTXPushFwd</A>, 50<A href="../stack/MTXPushInv.html">MTXPushInv</A>, 51<A href="../stack/MTXPushInvXpose.html">MTXPushInvXpose</A>, 52<A href="../../os/Alloc/OSAlloc.html">OSAlloc</A>, 53<A href="../../os/Alloc/OSFree.html">OSFree</A> 54</P> 55 56<H2>Revision History</H2> 57<P> 582006/03/01 Initial version.<br> 59</P> 60 61<hr><p>CONFIDENTIAL</p></body> 62</HTML>