#include <revolution/gx.h> void GXTexCoord2f32( f32 s, f32 t ); void GXTexCoord2u16( u16 s, u16 t ); void GXTexCoord2s16( s16 s, s16 t ); void GXTexCoord2u8 ( u8 s, u8 t ); void GXTexCoord2s8 ( s8 s, s8 t ); void GXTexCoord1f32( f32 s ); void GXTexCoord1u16( u16 s ); void GXTexCoord1s16( s16 s ); void GXTexCoord1u8 ( u8 s ); void GXTexCoord1s8 ( s8 s ); void GXTexCoord1x16( u16 index ); void GXTexCoord1x8 ( u8 index );
Will depend on function used.
None.
These functions are used to specify texture coordinate data for a vertex. It can be called only between the GXBegin function and the GXEnd function. Function names take the following format:
GXTexCoord[n][t]
The function name parameter n is one of {1, 2} and indicates the number of arguments to the function. The t function name parameter 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. The type letter indicates signed (s), unsigned (u), floating point (f), and index (x) data types. The subsequent number indicates the data size in bits, For example, u8 indicates an unsigned 8-bit data type. For example, the GXTexCoord2f32 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.
The selected function must correspond to the current vertex descriptor and the vertex attribute format specified in the GXBegin function. The current vertex descriptor is set using the GXSetVtxDesc function. The vertex attribute format is set using the GXSetVtxAttrFmt function.
Vertex functions must be called in the order specified by the GXSetVtxDesc function. Each vertex must send attributes (positions, colors, normals, etc.) in the specified order to guarantee proper parsing by the graphics hardware.
When an attribute is indexed (meaning its type, set by the GXSetVtxDesc function, is GX_INDEX8 or GX_INDEX16), 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 GXSetArray function. If an attribute is direct (meaning its type, set by the GXSetVtxDesc function, is GX_DIRECT), 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 GXSetVtxDesc function, is GX_NONE). However, every vertex must at least enable GX_VA_POS.
The GXTexCoord[n][t] 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 GXBegin and GXEnd functions (a common source of errors).
GXBegin, GXEnd, GXSetVtxDesc, GXSetVtxAttrFmt
2007/04/11 Corrected an error about an argument and added a description of the behavior that occurs when only one argument is specified.
2006/03/01 Initial version.
CONFIDENTIAL