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 align="left">MtxStack, MtxStackPtr</H1>
12<H2 align="left">C Specification</H2>
13<BLOCKQUOTE><CODE><CODE>#include &lt;revolution/mtx.h&gt;</CODE></CODE></BLOCKQUOTE>
14<BLOCKQUOTE><CODE><CODE>typedef struct<BR> {<BR> <BR> &nbsp;&nbsp;&nbsp; u32&nbsp;&nbsp;&nbsp; numMtx;<BR> &nbsp;&nbsp;&nbsp; MtxPtr stackBase;<BR> &nbsp;&nbsp;&nbsp; MtxPtr stackPtr;<BR> <BR> } MtxStack, *MtxStackPtr;</CODE></CODE></BLOCKQUOTE>
15<H2 align="left">Arguments</H2>
16<P align="left">None.</P>
17<H2 align="left">Return Values</H2>
18<P align="left">None.</P>
19<H2 align="left">Description</H2>
20<P>An <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>).&nbsp; Used in conjunction with a set of stack management routines, <code><strong>MtxStack</strong></code> provides the <code>MTX</code> library with an API to create and manage a stack of 3x4 matrices.</P>
21<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>
22<P><code><em><strong>stackBase</strong></em></code> is a pointer to the base of the <a href="Mtx_MtxPtr.html"><code>Mtx</code></a> array.&nbsp; When a <code><strong>MtxStack</strong></code> structure is first declared, <code><em><strong>stackBase</strong></em></code> has no memory allocated to it.&nbsp; The macro <code>MTXAllocStack</code> must be called to allocate memory to <code><em><strong>stackBase</strong></em></code>.&nbsp; This reserves <em><strong><code>numMtx</strong></em> * sizeof(<a href="Mtx_MtxPtr.html">Mtx</a>)</code> bytes.</P>
23<P>Use <code><em><strong>stackPtr</strong></em></code> to keep track of the current 'top of stack' matrix.&nbsp;This is adjusted in whole-matrix increments.</P>
24<P>An <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>
25
26
27<H2 align="left">See Also</H2>
28<P align="left"><A href="Mtx_MtxPtr.html"><CODE>Mtx, MtxPtr, </CODE></A><A href="../stack/MTXAllocStack.html"><CODE>MTXAllocStack</CODE></A>, <A href="../stack/MTXFreeStack.html"><CODE>MTXFreeStack</CODE></A>, <A href="../stack/MTXGetStackPtr.html"><CODE>MTXGetStackPtr</CODE></A>, <A href="../stack/MTXInitStack.html"><CODE>MTXInitStack</CODE></A>, <A href="../stack/MTXPop.html"><CODE>MTXPop</CODE></A>, <CODE><A href="../stack/MTXPush.html">MTXPush</A></CODE>, <A href="../stack/MTXPushFwd.html"><CODE>MTXPushFwd</CODE></A>, <A href="../stack/MTXPushInv.html"><CODE>MTXPushInv</CODE></A>, <A href="../stack/MTXPushInvXpose.html"><CODE>MTXPushInvXpose</CODE></A>, <A href="../../os/Alloc/OSAlloc.html"><CODE>OSAlloc</CODE></A>, <A href="../../os/Alloc/OSFree.html"><CODE>OSFree</CODE></A></P>
29<H2>Revision History</H2>
30<P>03/01/2006 Initial version.</P>
31</BODY>
32</HTML>