1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3
4<head>
5<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
6<META name="GENERATOR" content="Microsoft FrontPage 5.0">
7<META http-equiv="Content-Style-Type" content="text/css">
8<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css">
9<title>GXInitTexObj</title>
10</head>
11
12<body>
13
14<h1 align="left">GXInitTexObj</h1>
15
16<h2>Syntax</h2>
17<dl><dd><pre class="construction">
18#include &lt;revolution/gx.h&gt;
19
20void GXInitTexObj(
21    <a href="../Structures/GXTexObj.html">GXTexObj</a>*      obj,
22    void*          image_ptr,
23    u16            width,
24    u16            height,
25    <a href="../Enumerated_Types/GXTexFmt.html">GXTexFmt</a>       format,
26    <a href="../Enumerated_Types/GXTexWrapMode.html">GXTexWrapMode</a>  wrap_s,
27    <a href="../Enumerated_Types/GXTexWrapMode.html">GXTexWrapMode</a>  wrap_t,
28    <a href="../Enumerated_Types/GXBool.html">GXBool</a>         mipmap );
29</pre></dd></dl>
30
31<h2>Arguments</h2>
32<TABLE class="arguments" border="1" >
33  <tr>
34<TH><em><strong><code>obj</code></strong></em></TH>
35<TD>Pointer to a texture object.</TD>
36  </tr>
37  <tr>
38<TH><STRONG><EM><CODE>image_ptr</CODE></EM></STRONG></TH>
39<TD>Pointer to the image data for a texture. 32-byte aligned.</TD>
40  </tr>
41  <tr>
42<TH>width</TH>
43<TD>Width of the texture or LOD 0 for mipmaps. Maximum value is 1024. For mipmaps, or when <code>GX_REPEAT</code> or <code>GX_MIRROR</code> is the wrap mode for <SPAN class="argument">wrap_s</SPAN>, width must be a power of two.</TD>
44  </tr>
45  <tr>
46<TH>height</TH>
47<TD>Height of the texture or LOD 0 for mipmaps. Maximum value is 1024. For mipmaps, or when <code>GX_REPEAT</code> or <code>GX_MIRROR</code> is the wrap mode for <SPAN class="argument">wrap_t</SPAN>, height must be a power of two.</TD>
48  </tr>
49  <tr>
50<TH>format</TH>
51<TD>The texel <a href="../Enumerated_Types/GXTexFmt.html">format</a>.&nbsp;Accepted values are:<BR>
52      <TABLE class="arguments" border="1" >
53          <tr>
54<TD bgcolor="#C0C0C0">Name</TD>
55<TD bgcolor="#C0C0C0">Texture Format</TD>
56          </tr>
57          <tr>
58<TH>GX_TF_I4</TH>
59<TD>4-bit intensity</TD>
60          </tr>
61          <tr>
62<TH>GX_TF_IA4</TH>
63<TD>4-bit intensity + 4-bit alpha</TD>
64          </tr>
65          <tr>
66<TH>GX_TF_I8</TH>
67<TD>8-bit intensity</TD>
68          </tr>
69          <tr>
70<TH>GX_TF_IA8</TH>
71<TD>8-bit intensity + 8-bit alpha</TD>
72          </tr>
73          <tr>
74<TH>GX_TF_RGB565</TH>
75<TD>16-bit color (RGB565)</TD>
76          </tr>
77          <tr>
78<TH>GX_TF_RGB5A3</TH>
79<TD>16-bit color + alpha (RGB555 or RGBA4443)</TD>
80          </tr>
81          <tr>
82<TH>GX_TF_RGBA8</TH>
83<TD>32-bit full RGBA (8 bits each)</TD>
84          </tr>
85          <tr>
86<TH>GX_TF_CMPRl</TH>
87<TD>Compressed format (4 bits/texel)</TD>
88          </tr>
89          <tr>
90<TH>GX_TF_Z8</TH>
91<TD>Z texture 8bit  (see <A href="../Tev/GXSetZTexture.html"><CODE>GXSetZTexture</CODE></A> for details)</TD>
92          </tr>
93          <tr>
94<TH>GX_TF_Z16</TH>
95<TD>Z texture 16bit (see <A href="../Tev/GXSetZTexture.html"><CODE>GXSetZTexture</CODE></A> for details)</TD>
96          </tr>
97          <tr>
98<TH>GX_TF_Z24X8</TH>
99<TD>Z texture 24bit (see <A href="../Tev/GXSetZTexture.html"><CODE>GXSetZTexture</CODE></A> for details)</TD>
100          </tr>
101      </TABLE>
102    </TD>
103  </tr>
104  <tr>
105<TH>wrap_s</TH>
106<TD>Describes how texture coordinates will be wrapped in the S direction. Accepted values are:<BR>
107      <TABLE class="arguments" border="1" >
108          <tr>
109<TD bgcolor="#C0C0C0">Name</TD>
110<TD bgcolor="#C0C0C0">Wrap Mode</TD>
111          </tr>
112          <tr>
113<TH>GX_CLAMP</TH>
114<TD>Clamping within the bounds of the image</TD>
115          </tr>
116          <tr>
117<TH>GX_REPEAT</TH>
118<TD>Simple repeating</TD>
119          </tr>
120          <tr>
121<TH>GX_MIRROR</TH>
122<TD>Repeating with mirroring</TD>
123          </tr>
124      </TABLE>
125    </TD>
126  </tr>
127  <tr>
128<TH>wrap_t</TH>
129<TD>Describes how texture coordinates will be wrapped in the T direction. Accepted values are:<BR>
130      <TABLE class="arguments" border="1" >
131          <tr>
132<TD bgcolor="#C0C0C0">Name</TD>
133<TD bgcolor="#C0C0C0">Wrap Mode</TD>
134          </tr>
135          <tr>
136<TH>GX_CLAMP</TH>
137<TD>Clamping within the bounds of the image</TD>
138          </tr>
139          <tr>
140<TH>GX_REPEAT</TH>
141<TD>Simple repeating</TD>
142          </tr>
143          <tr>
144<TH>GX_MIRROR</TH>
145<TD>Repeating with mirroring</TD>
146          </tr>
147      </TABLE>
148    </TD>
149  </tr>
150  <tr>
151<TH>mipmap</TH>
152<TD>When <SPAN class="argument">mipmap</SPAN> = <CODE>GX_TRUE</CODE>, the texture is a mipmap and will have trilinear filtering; if not <CODE>GX_TRUE</CODE>, it is not a mipmap and will use bilinear filtering.</TD>
153  </tr>
154</TABLE>
155
156<h2>Return Values</h2>
157<p>None.</p>
158
159<H2>Description</H2>
160<P>This function is used to initialize or change a texture object for non-color index textures.&nbsp;Texture objects are used to describe all the parameters associated with a texture, including size, format, wrap modes, filter modes, etc.&nbsp;The application must provide memory for texture objects. Once initialized, a texture object can be associated with one of eight active IDs using the <A href="GXLoadTexObj.html"><CODE>GXLoadTexObj</CODE></A> function.</P>
161<P>To initialize a texture object for color index format textures, use the <A href="GXInitTexObjCI.html"><CODE>GXInitTexObjCI</CODE></A> function.</P>
162<P>If the <SPAN class="argument">mipmap</SPAN> flag is <code>GX_TRUE</code>, then the texture is a mipmap and will be trilinear interpolated. If the <SPAN class="argument">mipmap</SPAN> flag is <CODE>GX_FALSE</CODE>, the texture is not a mipmap and will be bilinear interpolated. To override the filter modes, or use other mipmap controls, call the <A href="GXInitTexObjLOD.html"><CODE>GXInitTexObjLOD</CODE></A> function after <code>GXInitTexObj</code>. Mipmap textures should set the width and height to a power of two, but mipmaps do not need to be square.</P>
163
164<h2>See Also</h2>
165<p class="reference">
166<a href="GXInitTexObjCI.html">GXInitTexObjCI</a>,
167<a href="GXInitTexObjLOD.html">GXInitTexObjLOD</a>,
168<a href="GXLoadTexObj.html">GXLoadTexObj</a>,
169<A href="GXTexObjInitFlow.html">GXTexObj Initialization Flow</A>
170</P>
171
172<H2>Revision History</H2>
173<P>
1742006/03/01 Initial version.<br>
175</P>
176
177<hr><p>CONFIDENTIAL</p></body>
178</HTML>