1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
9<title>GXMatrixIndex</title>
10</head>
11
12<body>
13
14<h1 align="left">GXMatrixIndex</h1>
15
16<h2>C Specification</h2>
17
18<dl>
19<dd><pre><CODE>#include &lt;revolution/gx.h&gt;</CODE></pre></dd>
20<dd><pre><CODE>void GXMatrixIndex1u8 ( u8  index );
21void GXMatrixIndex1x8 ( u8  index );</CODE></pre></dd>
22</dl>
23<h2>Arguments</h2>
24<TABLE border="1" cellpadding="3" cellspacing="0.1">
25  <tr>
26<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>index</CODE></strong></em></TD>
27<TD width="520">Unsigned, eight-bit index to matrix memory. This number represents the first row of matrix memory where the matrix is loaded.</TD>
28    </tr>
29</TABLE>
30<h2>Return Values</h2>
31<P>None.</P>
32<H2>Description</H2>
33<P>This function is used to specify matrix index data for a vertex.&nbsp;It can only be called between <a href="GXBegin.html"><code>GXBegin</code></a> and <a href="GXEnd.html"><code>GXEnd</code></a>.&nbsp;The matrix index specifies which matrix (previously loaded into matrix memory, see <a href="../Transform/GXLoadPosMtxImm.html"><code>GXLoadPosMtxImm</code></a>, <a href="../Transform/GXLoadNrmMtxImm.html"><code>GXLoadNrmMtxImm</code></a>, and <a href="../Transform/GXLoadTexMtxImm.html"><code>GXLoadTexMtxImm</code></a>) to use to transform this vertex's data.<br></P>
34<P>To use this function for a vertex, you must enable a matrix index in the <em>current vertex descriptor</em>.&nbsp;The current vertex descriptor is set using <a href="GXSetVtxDesc.html"><code>GXSetVtxDesc</code></a>.&nbsp;There is no need to set a <em>vertex attribute format</em> (<a href="GXSetVtxAttrFmt.html"><code>GXSetVtxAttrFmt</code></a>) because the index must be an unsigned eight-bit number. Both <code>GXMatrixIndex1u8</code> and <code>GXMatrixIndex1x8</code> are identical.</P>
35<P>The order in which vertex functions must be called is specified by <a href="GXSetVtxDesc.html"><code>GXSetVtxDesc</code></a>.&nbsp;Each vertex must send attributes (positions, colors, normals, etc.) in the specified order to guarantee proper interpretation by the graphics hardware.&nbsp;</P>
36<P>The <code>GXMatrixIndex1u8(GXMatrixIndex1x8)</code>&nbsp;is implemented as an inline function in the non-debug version of the <code>GX</code> library for optimal performance.&nbsp;The <code>GXMatrixIndex1u8(GXMatrixIndex1x8)</code>&nbsp;is implemented as a regular function in the debug version of the <code>GX</code> library so the library can verify the correct order of vertex function calls between <code><a href="GXBegin.html">GXBegin</a>/<a href="GXEnd.html">GXEnd</a></code> (a common source of errors).</P>
37
38<h2>See Also</h2>
39
40<p><a href="GXBegin.html">GXBegin</a>&nbsp;<br> <a href="GXEnd.html">GXEnd</a><br> <a href="GXSetVtxDesc.html">GXSetVtxDesc</a><br> <a href="GXSetVtxAttrFmt.html">GXSetVtxAttrFmt</a></p>
41<H2>Revision History</H2>
42<P>03/01/2006 Initial version.</P>
43</BODY>
44</HTML>