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>GXSetTlutRegionCallback</title>
10</head>
11
12<body>
13
14<h1 align="left">GXSetTlutRegionCallback</h1>
15
16
17<h2>C Specification</h2>
18
19<dl>
20<dd><pre><CODE>#include &lt;revolution/gx.h&gt;
21
22typedef <a href="../Structures/GXTlutRegion.html">GXTlutRegion</a> *(* GXTlutRegionCallback)( u32 tlut_name );</CODE></pre>
23  </dd>
24<dd><pre><CODE>GXTlutRegionCallback GXSetTlutRegionCallback( GXTlutRegionCallback f );</CODE></pre>
25  </dd>
26</dl>
27
28<h2>Arguments</h2>
29<TABLE border="1" cellpadding="3" cellspacing="0.1">
30  <tr>
31<TD width="120" valign="top" bgcolor="#ffffe8"><em><strong><CODE>f</CODE></strong></em></TD>
32<TD width="520">Pointer to a function that takes the <CODE>u32</CODE> TLUT name as an argument and returns a pointer to <CODE>GXTlutRegion</CODE></A>.</TD>
33    </tr>
34</TABLE>
35<h2>Return Values</h2>
36
37<p>This function returns a pointer to the previous callback function.</p>
38<H2>Description</H2>
39<P>The function <code><em><strong>f</strong></em></code> is called by <a href="GXLoadTlut.html"><code>GXLoadTlut</code></a> to find the region into which to load the TLUT.&nbsp;<a href="GXLoadTexObj.html"><code>GXLoadTexObj</code></a> will also call <code><em><strong>f</strong></em></code> to obtain the texture lookup table (TLUT) region when the texture format is color-index.</P>
40<P>For a given <strong><em><code>tlut_name</code></em></strong>, <code><em><strong>f</strong></em></code> <EM>must</EM> always return the <EM>same</EM> <a href="../Structures/GXTlutRegion.html"><code>GXTlutRegion</code></a>.&nbsp;This is because <a href="GXLoadTlut.html"><code>GXLoadTlut</code></a> will initialize data into the <a href="../Structures/GXTlutRegion.html"><code>GXTlutRegion</code></a> which <a href="GXLoadTexObj.html"><code>GXLoadTexObj</code></a> will use subsequently.</P>
41<P><a href="../Management/GXInit.html"><code>GXInit</code></a> calls <a href="GXSetTlutRegionCallback.html"><code>GXSetTlutRegionCallback</code></a> to set a default TLUT index-to-region mapping.&nbsp;The name for the TLUT from the texture object is provided as an argument to the callback. The callback should return a pointer to the <a href="../Structures/GXTlutRegion.html"><code>GXTlutRegion</code></a> for this TLUT index.</P>
42<BLOCKQUOTE><font size="3"><code>// example of a simple TLUT region lookup<br> GXTlutRegion *__GXGetTlutRegion(u32 idx)<br> {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return(__GXTlutRegionTab[idx]);<br> }<br> <br> GXSetTlutRegionCallback( __GXGetTlutRegion ); // GXInit</code></font></BLOCKQUOTE>
43
44<h2>See Also</h2>
45
46<p><a href="../Management/GXInit.html">GXInit</a><br> <a href="GXLoadTexObj.html">GXLoadTexObj</a><br> <a href="GXLoadTlut.html">GXLoadTlut</a><br> <a href="GXSetTexRegionCallback.html">GXSetTexRegionCallback</a></p>
47<p><a href="GXTMEMDefault.html">GX Default TMEM Configuration</a></p>
48<H2>Revision History</H2>
49<P>03/01/2006 Initial version.</P>
50</BODY>
51</HTML>