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>GXPosition[n][t]</TITLE>
9</HEAD>
10<BODY>
11<H1 align="left">GXPosition</H1>
12<H2>C Specification</H2>
13<DL>
14  <DD>
15<PRE><CODE>#include &lt;revolution/gx.h&gt;
16
17void GXPosition3f32( f32 x, f32 y, f32 z );
18void GXPosition3u16( u16 x, u16 y, u16 z );
19void GXPosition3s16( s16 x, s16 y, s16 z );
20void GXPosition3u8 ( u8  x, u8  y, u8  z );
21void GXPosition3s8 ( s8  x, s8  y, s8  z );
22
23void GXPosition2f32( f32 x, f32 y );
24void GXPosition2u16( u16 x, u16 y );
25void GXPosition2s16( s16 x, s16 y );
26void GXPosition2u8 ( u8  x, u8  y );
27void GXPosition2s8 ( s8  x, s8  y );
28
29void GXPosition1x16( u16 index );
30void GXPosition1x8 ( u8  index );</CODE></PRE>
31</DL>
32<H2>Arguments</H2>
33<P>Will depend on function used.</P>
34<H2>Return Values</H2>
35<P>None.</P>
36<H2>Description</H2>
37<P>These functions are used to specify position 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;Function names take the following format:</P>
38<P><CODE>GXPosition[n][t]</CODE></P>
39<P> </P>
40<P>The function name parameter <CODE>n</CODE> is a number from 1 through 3 and describes the number of function arguments. The function name parameter <code>t</code> describes the type of each argument to the function and can be one of the following values: s8, u8, s16, u16, f32, x8, or x16.&nbsp;The type letter indicates signed (<CODE>s</CODE>), unsigned (<CODE>u</CODE>), floating point (<code>f</code>), and index (<code>x</code>) data types.&nbsp;The subsequent number indicates the data's size in bits, For example, <code>u8</code> indicates an unsigned 8-bit quantity.&nbsp;For example, <code>GXPosition3f32</code> expects three floating point arguments.</P>
41<P>The selected function must correspond to the current vertex descriptor and the vertex attribute format specified in the <a href="GXBegin.html"><code>GXBegin</code></a> function.&nbsp;The current vertex descriptor is set using the <a href="GXSetVtxDesc.html"><code>GXSetVtxDesc</code></a> function.&nbsp;The vertex attribute format is set using <a href="GXSetVtxAttrFmt.html"><code>GXSetVtxAttrFmt</code></a>.</P>
42<P>The order in which vertex functions must be called is specified by&nbsp;the <a href="GXSetVtxDesc.html"><code>GXSetVtxDesc</code></a> function.&nbsp;Each vertex must send attributes (positions, colors, normals, etc.) in the specified order to guarantee proper interpretation by the graphics hardware.&nbsp;</P>
43<P>When an attribute is indexed (i.e., its type, set by <a href="GXSetVtxDesc.html"><code>GXSetVtxDesc</code></a>, is <code>GX_INDEX8</code> or <code>GX_INDEX16</code>), the vertex function will specify an index to the data, not the data itself.&nbsp;The location of the array that will be indexed is described using <a href="GXSetArray.html"><code>GXSetArray</code></a>. When an attribute is direct (i.e., its type, set by <a href="GXSetVtxDesc.html"><code>GXSetVtxDesc</code></a>, is <code>GX_DIRECT</code>), the vertex function sends the data.&nbsp;No vertex function should be called for an attribute which is disabled (i.e., its type, set by <a href="GXSetVtxDesc.html"><code>GXSetVtxDesc</code></a>, is <code>GX_NONE</code>).&nbsp;However, every vertex must at least enable <code>GX_VA_POS</code>.</P>
44<P>The <code>GXPosition[n][t]</code> functions are implemented as inline functions in the non-debug version of the GX library for optimal performance.&nbsp;The <code>GXNormal[n][t]</code> functions are implemented as functions in the debug version of the library so it can verify the correct order of vertex function calls between <CODE><a href="GXBegin.html">GXBegin</a></CODE> and <CODE><a href="GXEnd.html">GXEnd</a></CODE> (a common source of errors).</P>
45<H2>See Also</H2>
46<P><CODE><A href="GXBegin.html">GXBegin</A>&nbsp;&nbsp;<BR> <A href="GXEnd.html">GXEnd</A><BR> <A href="GXSetVtxDesc.html">GXSetVtxDesc</A><BR> <A href="GXSetVtxAttrFmt.html">GXSetVtxAttrFmt</A></CODE></P>
47<H2>Revision History</H2>
48<P>2006/03/01 Initial version.</P>
49<hr>
50<P>CONFIDENTIAL</p>
51</BODY>
52</HTML>