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>GXTexCoord[n][t]</TITLE> 9</HEAD> 10<BODY> 11<H1 align="left">GXTexCoord</H1> 12 13<H2>Syntax</H2> 14<dl><dd><pre class="construction"> 15#include <revolution/gx.h> 16 17void GXTexCoord2f32( f32 s, f32 t ); 18void GXTexCoord2u16( u16 s, u16 t ); 19void GXTexCoord2s16( s16 s, s16 t ); 20void GXTexCoord2u8 ( u8 s, u8 t ); 21void GXTexCoord2s8 ( s8 s, s8 t ); 22 23void GXTexCoord1f32( f32 s ); 24void GXTexCoord1u16( u16 s ); 25void GXTexCoord1s16( s16 s ); 26void GXTexCoord1u8 ( u8 s ); 27void GXTexCoord1s8 ( s8 s ); 28 29void GXTexCoord1x16( u16 index ); 30void GXTexCoord1x8 ( 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 texture coordinate data for a vertex. 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. Function names take the following format:</P> 41<BLOCKQUOTE><CODE>GXTexCoord[n][t]</CODE></BLOCKQUOTE> 42<P> </P> 43<P>The function name parameter <CODE>n</CODE> is one of {1, 2} and indicates the number of arguments to the function. 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>. The type letter indicates signed (<CODE>s</CODE>), unsigned (<CODE>u</CODE>), floating point (<code>f</code>), and index (<code>x</code>) data types. The subsequent number indicates the data size in bits, For example, <code>u8</code> indicates an unsigned 8-bit data type. For example, the <code>GXTexCoord2f32</code> function expects two floating point arguments. When only one argument is specified (excluding the index data type), it specifies the texture coordinate S component. The T component is assumed to be zero.</P> 44<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. The current vertex descriptor is set using the <A href="GXSetVtxDesc.html"><CODE>GXSetVtxDesc</CODE></A> function. The vertex attribute format is set using the <A href="GXSetVtxAttrFmt.html"><CODE>GXSetVtxAttrFmt</CODE></A> function.</P> 45<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 (positions, colors, normals, etc.) in the specified order to guarantee proper parsing by the graphics hardware.</P> 46<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> 47<P>The <code>GXTexCoord[n][t]</code> functions are implemented as inline functions in the non-debug version of the GX library for optimal performance. These functions are implemented in the debug version of the library so it can verify the correct order of vertex function calls between the <CODE><a href="GXBegin.html">GXBegin</a></CODE> and <CODE><a href="GXEnd.html">GXEnd</a></CODE> functions (a common source of errors).</P> 48 49<H2>See Also</H2> 50<P class="reference"> 51<A href="GXBegin.html">GXBegin</A>, 52<A href="GXEnd.html">GXEnd</A>, 53<A href="GXSetVtxDesc.html">GXSetVtxDesc</A>, 54<A href="GXSetVtxAttrFmt.html">GXSetVtxAttrFmt</A> 55</P> 56 57<H2>Revision History</H2> 58<P> 592007/04/11 Corrected an error about an argument and added a description of the behavior that occurs when only one argument is specified.<BR>2006/03/01 Initial version.<br> 60</P> 61 62<hr><p>CONFIDENTIAL</p></body> 63</HTML>