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>GXSetVtxAttrFmt</TITLE> 9</HEAD> 10<BODY> 11<H1 align="left">GXSetVtxAttrFmt</H1> 12 13<H2>Syntax</H2> 14<dl><dd><pre class="construction"> 15#include <revolution/gx.h> 16 17void GXSetVtxAttrFmt( 18 <A href="../Enumerated_Types/GXVtxFmt.html">GXVtxFmt</A> vtxfmt, 19 <A href="../Enumerated_Types/GXAttr.html">GXAttr</A> attr, 20 <A href="../Enumerated_Types/GXCompCnt.html">GXCompCnt</A> cnt, 21 <A href="../Enumerated_Types/GXCompType.html">GXCompType</A> type, 22 u8 frac); 23</pre></dd></dl> 24 25<H2>Arguments</H2> 26<TABLE class="arguments" border="1" > 27 <TBODY> 28 <TR> 29<TH>vtxfmt</TH> 30<TD>Specifies the vertex format <A href="../Enumerated_Types/GXVtxFmt.html">number</A>.</TD> 31 </TR> 32 <TR> 33<TH>attr</TH> 34<TD>Specifies the attribute name. Specifiable values are: <CODE>GX_VA_POS, GX_VA_NRM, GX_VA_NBT, GX_VA_CLR0, GX_VA_CLR1, GX_VA_TEX0, GX_VA_TEX1, GX_VA_TEX2, GX_VA_TEX3, GX_VA_TEX4, GX_VA_TEX5, GX_VA_TEX6, GX_VA_TEX7</CODE>.</TD> 35 </TR> 36 <TR> 37<TH>cnt</TH> 38 <TD> 39 <TABLE class="arguments" border="1" > 40 <TBODY> 41 <TR> 42<TD bgcolor="#C0C0C0">Attributes</TD> 43<TD bgcolor="#C0C0C0">Values that can be specified for <SPAN class="argument">cnt</SPAN></TD> 44 </TR> 45 <TR> 46 <TH>GX_VA_POS</TH> 47 <TD><CODE>GX_POS_XYZ, GX_POS_XY</CODE></TD> 48 </TR> 49 <TR> 50 <TH>GX_VA_NRM</TH> 51 <TD><CODE>GX_NRM_XYZ</CODE></TD> 52 </TR> 53 <TR> 54 <TH>GX_VA_NBT</TH> 55 <TD><CODE>GX_NRM_NBT, GX_NRM_NBT3</CODE></TD> 56 </TR> 57 <TR> 58 <TH>GX_VA_CLR0-1</TH> 59 <TD><CODE>GX_CLR_RGB, GX_CLR_RGBA</CODE></TD> 60 </TR> 61 <TR> 62 <TH>GX_VA_TEX0-7</TH> 63 <TD><CODE>GX_TEX_ST, GX_TEX_S</CODE></TD> 64 </TR> 65 </TBODY> 66 </TABLE> 67 </TD> 68 </TR> 69 <TR> 70 <TH>type</TH> 71 <TD> 72 <TABLE class="arguments" border="1" > 73 <TBODY> 74 <TR> 75<TD bgcolor="#C0C0C0">Attributes</TD> 76<TD bgcolor="#C0C0C0">Values that can be specified for <SPAN class="argument">type</SPAN></TD> 77 </TR> 78 <TR> 79 <TH>GX_VA_POS, GX_VA_TEX0-7</TH> 80 <TD><CODE>GX_U8, GX_S8, GX_U16, GX_S16, GX_F32</CODE></TD> 81 </TR> 82 <TR> 83 <TH>GX_VA_NRM, GX_VA_NBT</TH> 84 <TD><CODE>GX_S8, GX_S16, GX_F32</CODE></TD> 85 </TR> 86 <TR> 87 <TH>GX_VA_CLR0-1</TH> 88 <TD><CODE>GX_RGB565, GX_RGB8, GX_RGBX8, GX_RGBA4, GX_RGBA6, GX_RGBA8</CODE></TD> 89 </TR> 90 </TBODY> 91 </TABLE> 92 </TD> 93 </TR> 94 <TR> 95 <TH>frac</TH> 96 <TD> 97 <TABLE class="arguments" border="1" > 98 <TBODY> 99 <TR> 100 <TD bgcolor="#C0C0C0"><SPAN class="argument">Attr</SPAN></TD> 101 <TD bgcolor="#C0C0C0"><SPAN class="argument">type</SPAN></TD> 102 <TD bgcolor="#C0C0C0"><SPAN class="argument">frac</SPAN>, accepted values</TD> 103 </TR> 104 <TR> 105 <TH rowspan="4">GX_VA_POS, GX_VA_TEX0-7</TH> 106 <TD><CODE>GX_U8</CODE></TD> 107 <TD><CODE>0-31 (only 0 for HW1)</CODE></TD> 108 </TR> 109 <TR> 110 <TD><CODE>GX_S8</CODE></TD> 111 <TD><CODE>0-31 (only 0 for HW1)</CODE></TD> 112 </TR> 113 <TR> 114 <TD><CODE>GX_U16</CODE></TD> 115 <TD><CODE>0-31</CODE></TD> 116 </TR> 117 <TR> 118 <TD><CODE>GX_S16</CODE></TD> 119 <TD><CODE>0-31</CODE></TD> 120 </TR> 121 <TR> 122 <TH rowspan="2">GX_VA_NRM or GX_VA_NBT</TD> 123 <TD><CODE>GX_S8</CODE></TD> 124 <TD><CODE>implied, 6</CODE></TD> 125 </TR> 126 <TR> 127 <TD><CODE>GX_S16</CODE></TD> 128 <TD><CODE>implied, 14</CODE></TD> 129 </TR> 130 </TBODY> 131 </TABLE> 132<P>Number of fractional bits of a fixed point number. Range is 0 <= <SPAN class="argument">frac</SPAN> <= 31. <SPAN class="argument">frac</SPAN> is ignored when a floating point number or color is used.</P> 133 </TD> 134 </TR> 135 </TBODY> 136</TABLE> 137 138<H2>Return Values</H2> 139<P>None.</P> 140 141<H2>Description</H2> 142<P>This function sets the attribute format (<SPAN class="argument">attr</SPAN>) for a single attribute in the vertex attribute format table (VAT). Each attribute format describes the data type (<SPAN class="argument">type</SPAN>), number of elements (<SPAN class="argument">cnt</SPAN>), and if required the fixed point format (<SPAN class="argument">frac</SPAN>). There are eight vertex formats available in the VAT. The vertex format describes the format of all attributes in a vertex. The application can pre-program all eight vertex formats, and then select one of them during the actual rendering of geometry. (See the <A href="GXBegin.html"><CODE>GXBegin</CODE></A> function.) Be aware that all vertices used to render a particular graphics primitive will have the same format. The vertex format set using the <CODE>GXSetVtxAttrFmt</CODE> function, along with the current vertex descriptor set using the <A href="GXSetVtxDesc.html"><CODE>GXSetVtxDesc</CODE></A> function, completely define the vertex data format.</P> 143<P>The vertex format allows data to be sent to the graphics processor in its most quantized format. The graphics hardware will inverse-quantize the data (into floating point format) before it's used. The vertex attribute format is used to communicate the data quantization format to the hardware.</P> 144<P>Be aware that the <CODE>GX_VA_NRM</CODE> and <CODE>GX_VA_NBT</CODE> attributes share the same <SPAN class="argument">type</SPAN> and <SPAN class="argument">frac</SPAN>. Also, the <SPAN class="argument">frac</SPAN> for these attributes is fixed according to the type. The component count, <SPAN class="argument">cnt</SPAN>, for <CODE>GX_VA_NRM</CODE> must be set to <CODE>GX_NRM_XYZ</CODE>. The component count for <CODE>GX_VA_NBT</CODE> must be set to <CODE>GX_NRM_NBT</CODE>.</P> 145 146<H2>See Also</H2> 147<P class="reference"> 148<A href="GXSetVtxAttrFmtv.html">GXSetVtxAttrFmtv</A>, 149<A href="GXGetVtxAttrFmtv.html">GXGetVtxAttrFmtv</A>, 150<A href="GXSetVtxDescv.html">GXSetVtxDescv</A>, 151<A href="GXGetVtxDescv.html">GXGetVtxDescv</A>, 152<A href="GXSetVtxDesc.html">GXSetVtxDesc</A>, 153<A href="GXBegin.html">GXBegin</A> 154</P> 155 156<H2>Revision History</H2> 157<P> 1582006/03/01 Initial version.<br> 159</P> 160 161<hr><p>CONFIDENTIAL</p></body> 162</HTML>