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
13<H2>Syntax</H2>
14<dl><dd><pre class="construction">
15#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 );
31</pre></dd></dl>
32
33<H2>Arguments</H2>
34<P>Will depend on function used.</P>
35
36<H2>Return Values</H2>
37<P>None.</P>
38
39<H2>Description</H2>
40<P>These functions are used to specify position data for a vertex.&nbsp;It can be called only between the <a href="GXBegin.html"><code>GXBegin</code></a> function and the <a href="GXEnd.html"><code>GXEnd</code></a> function.&nbsp;Function names take the following format:</P>
41<P><CODE>GXPosition[n][t]</CODE></P>
42<P> </P>
43<P>The <CODE>n</CODE> function name parameter is <CODE>1</CODE>, <CODE>2</CODE>, or <CODE>3</CODE>, and describes the number of function arguments. The <code>t</code> function name parameter describes the type of each argument to the function and can be one of the following values: <CODE>s8</CODE>, u8, <CODE>s16</CODE>, <CODE>u16</CODE>, <CODE>f32</CODE>, <CODE>x8</CODE>, or <CODE>x16</CODE>.&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 bit size. For example, <code>u8</code> indicates an unsigned 8-bit data type. For example, <CODE>GXPosition3f32</CODE> expects three floating point arguments. If only two arguments are specified (if <CODE>GX_POS_XY</CODE> is specified for <CODE>cnt</CODE> in <A href="GXSetVtxAttrFmt.html"><CODE>GXSetVtxAttrFmt</CODE></A>), then only the texture coordinate X and Y components are specified, and the Z component is treated as 0.
44</P>
45<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 the <A href="GXSetVtxAttrFmt.html"><CODE>GXSetVtxAttrFmt</CODE></A> function.</P>
46<P>Vertex functions must be called in the order specified by the <A href="GXSetVtxDesc.html"><CODE>GXSetVtxDesc</CODE></A> function. Each vertex must send attributes (position coordinates, colors, normals, and so forth) in the specified order to guarantee proper parsing by the graphics hardware.</P>
47<P>When an attribute is indexed (meaning its type, set by the <A href="GXSetVtxDesc.html"><CODE>GXSetVtxDesc</CODE></A> function, is <CODE>GX_INDEX8</CODE> or <CODE>GX_INDEX16</CODE>), the vertex function specifies an index to the data, not the data itself. The location of the array that will be indexed is described using the <A href="GXSetArray.html"><CODE>GXSetArray</CODE></A> function. If an attribute is direct (meaning its type, set by the <A href="GXSetVtxDesc.html"><CODE>GXSetVtxDesc</CODE></A> function, is <CODE>GX_DIRECT</CODE>), the vertex function sends the data. No vertex function should be called for an attribute that is disabled (that is, its type, set by the <A href="GXSetVtxDesc.html"><CODE>GXSetVtxDesc</CODE></A> function, is <CODE>GX_NONE</CODE>). However, every vertex must at least enable <CODE>GX_VA_POS</CODE>.</P>
48<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>GXPosition[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>
49
50<H2>See Also</H2>
51<P class="reference">
52<A href="GXBegin.html">GXBegin</A>,
53<A href="GXEnd.html">GXEnd</A>,
54<A href="GXSetVtxDesc.html">GXSetVtxDesc</A>,
55<A href="GXSetVtxAttrFmt.html">GXSetVtxAttrFmt</A>
56</P>
57
58<H2>Revision History</H2>
59<P>
602008/06/20 Expanded the description of the case where only two arguments are specified.<br>2006/03/01 Initial version.<br>
61</P>
62
63<hr><p>CONFIDENTIAL</p></body>
64</HTML>