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 17<h2>C Specification</h2> 18 19<dl> 20 <dd><pre><CODE>#include <revolution/gx.h></CODE></pre> 21 </dd> 22 <dd><pre><CODE>void GXInitTexObj( 23 <a href="../Structures/GXTexObj.html">GXTexObj</a>* obj, 24 void* image_ptr, 25 u16 width, 26 u16 height, 27 <a href="../Enumerated_Types/GXTexFmt.html">GXTexFmt</a> format, 28 <a href="../Enumerated_Types/GXTexWrapMode.html">GXTexWrapMode</a> wrap_s, 29 <a href="../Enumerated_Types/GXTexWrapMode.html">GXTexWrapMode</a> wrap_t, 30 <a href="../Enumerated_Types/GXBool.html">GXBool</a> mipmap );</CODE></pre> 31 </dd> 32</dl> 33 34<h2>Arguments</h2> 35<TABLE border="1" cellpadding="3" cellspacing="0.1"> 36 <tr> 37<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>obj</CODE></strong></em></TD> 38<TD width="520">pointer to a texture object</TD> 39 </tr> 40 <tr> 41<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>image_ptr</CODE></strong></em></TD> 42<TD width="520">pointer to the image data for a texture <BR>32-byte aligned</TD> 43 </tr> 44 <tr> 45<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>width</CODE></strong></em></TD> 46<TD width="520">width of the texture or LOD 0 for mipmaps <BR>The maximum value is 1024. For mipmaps, or when <code>GX_REPEAT/GX_MIRROR</code> is the wrap mode for <CODE>wrap_s</CODE>, width must be a power of two.</TD> 47 </tr> 48 <tr> 49<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>height</CODE></strong></em></TD> 50<TD width="520">height of the texture or LOD 0 for mipmaps <BR>The maximum value is 1024. For mipmaps, or when <code>GX_REPEAT/GX_MIRROR</code> is the wrap mode for <CODE>wrap_t</CODE>, height must be a power of two.</TD> 51 </tr> 52 <tr> 53<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>format</CODE></strong></em></TD> 54<TD width="520">the texel <a href="../Enumerated_Types/GXTexFmt.html">format</a> <BR>Accepted values are:<BR> 55 <TABLE border="1" width="500" cellspacing="0.1"> 56 57 <tr> 58<TD width="150" bgcolor="#C0C0C0">Name</TD> 59<TD width="350" bgcolor="#C0C0C0">Texture Format</TD> 60 </tr> 61 <tr> 62<TD width="150"><code>GX_TF_I4</code></TD> 63<TD width="350">4-bit intensity</TD> 64 </tr> 65 <tr> 66<TD width="150"><code>GX_TF_IA4</code></TD> 67<TD width="350">4-bit intensity + 4-bit alpha </TD> 68 </tr> 69 <tr> 70<TD width="150"><code>GX_TF_I8</code></TD> 71<TD width="350">8-bit intensity</TD> 72 </tr> 73 <tr> 74<TD width="150"><code>GX_TF_IA8</code></TD> 75<TD width="350">8-bit intensity + 8-bit alpha</TD> 76 </tr> 77 <tr> 78<TD width="150"><code>GX_TF_RGB565</code></TD> 79<TD width="350">16-bit color (RGB565)</TD> 80 </tr> 81 <tr> 82<TD width="150"><code>GX_TF_RGB5A3</code></TD> 83<TD width="350">16-bit color + alpha (RGB555 or RGBA4443)</TD> 84 </tr> 85 <tr> 86<TD width="150"><code>GX_TF_RGBA8</code></TD> 87<TD width="350">32 bit full RGBA (8 bits each)</TD> 88 </tr> 89 <tr> 90<TD width="150"><code>GX_TF_CMPRl</code></TD> 91<TD width="350">compressed format (4 bits/texel)</TD> 92 </tr> 93 <tr> 94<TD width="150"><code>GX_TF_Z8</code></TD> 95<TD width="350">8-bit Z texture (see <a href="../Tev/GXSetZTexture.html"><CODE>GXSetZTexture</CODE></a> for details)</TD> 96 </tr> 97 <tr> 98<TD width="150"><code>GX_TF_Z16</code></TD> 99<TD width="350">16-bit Z texture (see <a href="../Tev/GXSetZTexture.html"><CODE>GXSetZTexture</CODE></a> for details)</TD> 100 </tr> 101 <tr> 102<TD width="150"><code>GX_TF_Z24X8</code></TD> 103<TD width="350">24-bit Z texture (see <a href="../Tev/GXSetZTexture.html"><CODE>GXSetZTexture</CODE></a> for details)</TD> 104 </tr> 105 106 </TABLE> 107 </TD> 108 </tr> 109 <tr> 110<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>wrap_s</CODE></strong></em></TD> 111<TD width="520">describes how texture coordinates will be wrapped in the s direction <BR>Accepted values are:<BR> 112 <TABLE border="1" width="500" cellspacing="0.1"> 113 114 <tr> 115<TD width="150" bgcolor="#C0C0C0">Name</TD> 116<TD width="350" bgcolor="#C0C0C0">Wrap Mode</TD> 117 </tr> 118 <tr> 119<TD width="150"><code>GX_CLAMP</code></TD> 120<TD width="350">clamping within the bounds of the image</TD> 121 </tr> 122 <tr> 123<TD width="150"><code>GX_REPEAT</code></TD> 124<TD width="350">simple repeating</TD> 125 </tr> 126 <tr> 127<TD width="150"><code>GX_MIRROR</code></TD> 128<TD width="350">repeating with mirroring</TD> 129 </tr> 130 131 </TABLE> 132 </TD> 133 </tr> 134 <tr> 135<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>wrap_t</CODE></strong></em></TD> 136<TD width="520">describes how texture coordinates will be wrapped in the t direction <BR>Accepted values are:<BR> 137 <TABLE border="1" width="500" cellspacing="0.1"> 138 139 <tr> 140<TD width="150" bgcolor="#C0C0C0">Name</TD> 141<TD width="350" bgcolor="#C0C0C0">Wrap Mode</TD> 142 </tr> 143 <tr> 144<TD width="150"><code>GX_CLAMP</code></TD> 145<TD width="350">clamping within the bounds of the image</TD> 146 </tr> 147 <tr> 148<TD width="150"><code>GX_REPEAT</code></TD> 149<TD width="350">simple repeating</TD> 150 </tr> 151 <tr> 152<TD width="150"><code>GX_MIRROR</code></TD> 153<TD width="350">repeating with mirroring</TD> 154 </tr> 155 156 </TABLE> 157 </TD> 158 </tr> 159 <tr> 160<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>mipmap</CODE></strong></em></TD> 161<TD width="520">When <code>mipmap = GX_TRUE</code>, the texture is a mipmap and will have trilinear filtering; otherwise, it is not a mipmap and will use bilinear filtering.</TD> 162 </tr> 163</TABLE> 164<h2>Return Values</h2> 165 166<p>None.</p> 167<H2>Description</H2> 168<P>This function is used to initialize or change a texture object for non-color index textures. Texture objects are used to describe all the parameters associated with a texture, including size, format, wrap modes, filter modes, etc. The application must provide memory for texture objects. Once initialized, a texture object can be associated with one of the eight active IDs using the <a href="GXLoadTexObj.html"><code>GXLoadTexObj</code></a> function.</P> 169<P>To initialize a texture object for color index format textures, use <a href="GXInitTexObjCI.html"><code>GXInitTexObjCI</code></a>.</P> 170<P>If the <code>mipmap</code> flag is <code>GX_TRUE</code>, then the texture is a mipmap and the texture will be trilerped. If the <code>mipmap</code> flag is <code>GX_FALSE</code>, the texture is not a mipmap and the texture will be bilerped. To override the filter modes and other mipmap controls, call <a href="GXInitTexObjLOD.html"><code>GXInitTexObjLOD</code></a> 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> 171 172<h2>See Also</h2> 173 174<p><a href="GXInitTexObjCI.html"><CODE>GXInitTexObjCI</CODE></a><br> <a href="GXInitTexObjLOD.html"><CODE>GXInitTexObjLOD</CODE></a><br> <a href="GXLoadTexObj.html"><CODE>GXLoadTexObj</CODE></a></p> 175<P><A href="GXTexObjInitFlow.html"><CODE>GXTexObj</CODE> Initialization Flow</A></P> 176<H2>Revision History</H2> 177<P>2006/03/01 Initial version.</P> 178<hr> 179<P>CONFIDENTIAL</p> 180</BODY> 181</HTML>