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>GXInitTexPreLoadRegion</title>
10</head>
11
12<body>
13
14<h1 align="left">GXInitTexPreLoadRegion</h1>
15
16
17<h2>C Specification</h2>
18
19<dl>
20<dd><PRE><CODE>#include &lt;revolution/gx.h&gt;</CODE></PRE>
21  </dd>
22<dd><pre><CODE>void GXInitTexPreLoadRegion(
23<a href="../Structures/GXTexRegion.html">GXTexRegion</a><em>*      </em>region,
24u32               tmem_even,
25u32               size_even,
26u32               tmem_odd,
27u32               size_odd );</CODE></pre>
28  </dd>
29</dl>
30
31<h2>Arguments</h2>
32<TABLE border="1" cellpadding="3" cellspacing="0.1">
33  <tr>
34<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>region</CODE></strong></em></TD>
35<TD width="520">pointer to a <a href="../Structures/GXTexRegion.html"><code>GXTexRegion</code></a> structure</TD>
36    </tr>
37  <tr>
38<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>tmem_even</CODE></strong></em></TD>
39<TD width="520">base pointer to texture memory used for even-numbered LODs of the mipmap (see table below) <BR>Must be 32-byte aligned.</TD>
40    </tr>
41  <tr>
42<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>size_even</CODE></strong></em></TD>
43<TD width="520">the size of the even-numbered cache (in bytes) <BR>Must be in multiples of 32 bytes.</TD>
44    </tr>
45  <tr>
46<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>tmem_odd</CODE></strong></em></TD>
47<TD width="520">base pointer to texture memory used for odd-numbered LODs of the mipmap (see table below) <BR>Must be 32-byte aligned.</TD>
48    </tr>
49  <tr>
50<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>size_odd</CODE></strong></em></TD>
51<TD width="520">the size of the odd-numbered cache (in bytes) <BR>Must be in multiples of 32 bytes.</TD>
52    </tr>
53</TABLE>
54<h2>Return Values</h2>
55
56<p>None.</p>
57<H2>Description</H2>
58<P>This function initializes a texture memory (TMEM) region object for preloading.&nbsp;The region is allocated in TMEM by the application and can be used only as a pre-loaded buffer.&nbsp;Cache regions must be allocated by using the <a href="GXInitTexCacheRegion.html"><code>GXInitTexCacheRegion</code></a> function. For pre-loaded textures, the size of the region must match the size of the texture.&nbsp;An application can create many region objects and some of them can overlap. No two overlapping regions can be active at the same time, however.</P>
59<P>The maximum size of a region is 512 KB.</P>
60<P><a href="../Management/GXInit.html"><code>GXInit</code></a> creates no preloading regions. The application should allocate appropriate regions if preloading is necessary. In addition, a cache region and allocator must be created using <CODE><A href="GXInitTexCacheRegion.html">GXInitTexCacheRegion</A></CODE> and <CODE><A href="GXSetTexRegionCallback.html">GXSetTexRegionCallBack</A></CODE>. This is because the new cache region may overwrite the preload region. (Alternately, if you do not use any color index textures, you may preload textures into the portion of texture memory normally allocated to color index usage by the default allocator.))</P>
61<H4><B><A name="TMEM_rules">Texture Memory Region Allocation Rules</A></B></H4>
62<P>Texture memory is divided into high and low banks.&nbsp;The first 512 Kbytes is the low bank, the next 512 Kbytes is the high bank.&nbsp;Textures will have their components stored in the banks according to the rules below.&nbsp;Be aware that no component may span over the boundary between the two banks.&nbsp;The notation <em>m:n</em> refers to the address (m) and size (n) for a given range of the texture memory.&nbsp;CI is an abbreviation for color-index.</P>
63<TABLE border="1" cellpadding="3" cellspacing="0" width="847" height="377">
64  <TBODY>
65    <TR>
66<TD width="233" height="19"><B>Texture Types</B></TD>
67<TD width="602" height="19"><B>Allocation Rules</B></TD>
68    </TR>
69    <TR>
70<TD width="233" height="59">planar, 32 bit RGB, non-CI</TD>
71<TD width="602" height="59">Uses only <code>tmem_even:size_even</code>.<BR>Can use both banks.<BR>Parameters <code>tmem_odd:size_odd</code> should be set to <code>0:0</code>.</TD>
72    </TR>
73    <TR>
74<TD width="233" height="40">planar, 32 bit RGB, non-CI</TD>
75<TD width="602" height="40">Color element AR uses <code>tmem_even:size_even</code>. Must be in the low bank.<br>Color element GB uses <code>tmem_odd:size_odd</code>. Must be in the high bank.</TD>
76    </TR>
77    <TR>
78<TD width="233" height="59">planar, color index&nbsp;</TD>
79<TD width="602" height="59">Uses only <code>tmem_even:size_even</code>. Must be in the low bank.<br>(The corresponding TLUT will be accessed from the high bank.)<br>)<BR>Parameters <code>tmem_odd:size_odd</code> should be set to <code>0:0</code>.</TD>
80    </TR>
81    <TR>
82<TD width="233" height="39">mipmapped, non-32 bit RGB, non-CI&nbsp;</TD>
83<TD width="602" height="39">Even-numbered LODs use <code>tmem_even:size_even</code>. Odd LODs use <code>tmem_odd:size_odd</code>.<br>Even LODs may be in the high or low bank.&nbsp;Odd LODs must be in the opposite bank.</TD>
84    </TR>
85    <TR>
86<TD width="233">mipmapped, 32 bit RGB, non-CI&nbsp;</TD>
87<TD width="602">Even (AR) + odd (GB) LODs use <code>tmem_even:size_even</code>.<br>Even (GB) + odd (AR) LODs use <code>tmem_odd:size_odd</code>.</TD>
88    </TR>
89    <TR>
90<TD width="233">mipmapped, color index</TD>
91<TD width="602">Even-numbered LODs use <code>tmem_even:size_even</code>. Must be in the low bank.<br>Odd LODs use <code>tmem_odd:size_odd</code>.&nbsp;Must be in the low bank.<br>Be aware that trilinear filtering will not work for this texture type.</TD>
92    </TR>
93  </TBODY>
94</TABLE>
95
96<h2>See Also</h2>
97
98<p><A href="GXInitTexCacheRegion.html"><CODE>GXInitTexCacheRegion</CODE></A><BR> <A href="GXSetTexRegionCallback.html"><CODE>GXSetTexRegionCallBack</CODE></A><BR> <A href="GXInitTlutRegion.html"><CODE>GXInitTlutRegion</CODE></A><BR> <CODE><A href="GXSetTlutRegionCallback.html">GXSetTlutRegionCallBack</A></CODE><BR> <A href="GXGetTexRegionAll.html"><CODE>GXGetTexRegionAll</CODE></A></p>
99<p><a href="GXTMEMDefault.html">GX Default TMEM Configuration</a></p>
100<H2>Revision History</H2>
101<P>03/01/2006 Initial version.</P>
102</BODY>
103</HTML>