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<h2>Syntax</h2> 17<dl><dd><pre class="construction"> 18#include <revolution/gx.h> 19 20typedef <a href="../Structures/GXTlutRegion.html">GXTlutRegion</a> *(* GXTlutRegionCallback)( u32 tlut_name ); 21 22GXTlutRegionCallback GXSetTlutRegionCallback( GXTlutRegionCallback f ); 23</pre></dd></dl> 24 25<h2>Arguments</h2> 26<TABLE class="arguments" border="1" > 27 <tr> 28<TH><STRONG><EM><CODE>f</CODE></EM></STRONG></TH> 29<TD>Pointer to a function that takes the <CODE>u32</CODE> TLUT name as an argument and returns a pointer to a <A href="../Structures/GXTlutRegion.html"><CODE>GXTlutRegion</CODE></A> structure.</TD> 30 </tr> 31</TABLE> 32 33<h2>Return Values</h2> 34<p>This function returns a pointer to the previous callback function.</p> 35 36<H2>Description</H2> 37<P>The function, <SPAN class="argument">f</SPAN>, is called by the <A href="GXLoadTlut.html"><CODE>GXLoadTlut</CODE></A> region to find the region into which to load the TLUT. It is also called by the <A href="GXLoadTexObj.html"><CODE>GXLoadTexObj</CODE></A> function to obtain the texture lookup table (TLUT) region when the texture format is color-index.</P> 38<P>For a given <SPAN class="argument">tlut_name</SPAN>, <SPAN class="argument">f</SPAN> must always return the <EM>same</EM> <A href="../Structures/GXTlutRegion.html"><CODE>GXTlutRegion</CODE></A> structure. This is because the <A href="GXLoadTlut.html"><CODE>GXLoadTlut</CODE></A> function will initialize data into the <A href="../Structures/GXTlutRegion.html"><CODE>GXTlutRegion</CODE></A> which the <A href="GXLoadTexObj.html"><CODE>GXLoadTexObj</CODE></A> function will use subsequently.</P> 39<P>The <A href="../Management/GXInit.html"><CODE>GXInit</CODE></A> function calls the <A href="GXSetTlutRegionCallback.html"><CODE>GXSetTlutRegionCallback</CODE></A> function to set a default TLUT index-to-region mapping. 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> 40<BLOCKQUOTE><FONT size="2"><code>// example of a simple TLUT region lookup<br> GXTlutRegion *__GXGetTlutRegion(u32 idx)<br> {<br> return(__GXTlutRegionTab[idx]);<br> }<br> <br> GXSetTlutRegionCallback( __GXGetTlutRegion ); // GXInit</code></font></BLOCKQUOTE> 41 42<h2>See Also</h2> 43<P class="reference"> 44<a href="../Management/GXInit.html">GXInit</a>, 45<a href="GXLoadTexObj.html">GXLoadTexObj</a>, 46<a href="GXLoadTlut.html">GXLoadTlut</a>, 47<a href="GXSetTexRegionCallback.html">GXSetTexRegionCallback</a>, 48<a href="GXTMEMDefault.html">GX Default TMEM Configuration</a> 49</p> 50 51<H2>Revision History</H2> 52<P> 532006/03/01 Initial version.<br> 54</P> 55 56<hr><p>CONFIDENTIAL</p></body> 57</HTML>