#include <revolution/gx.h> typedef GXTlutRegion *(* GXTlutRegionCallback)( u32 tlut_name ); GXTlutRegionCallback GXSetTlutRegionCallback( GXTlutRegionCallback f );
f |
Pointer to a function that takes the u32 TLUT name as an argument and returns a pointer to a GXTlutRegion structure. |
|---|
This function returns a pointer to the previous callback function.
The function, f, is called by the GXLoadTlut region to find the region into which to load the TLUT. It is also called by the GXLoadTexObj function to obtain the texture lookup table (TLUT) region when the texture format is color-index.
For a given tlut_name, f must always return the same GXTlutRegion structure. This is because the GXLoadTlut function will initialize data into the GXTlutRegion which the GXLoadTexObj function will use subsequently.
The GXInit function calls the GXSetTlutRegionCallback 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 GXTlutRegion for this TLUT index.
// example of a simple TLUT region lookup
GXTlutRegion *__GXGetTlutRegion(u32 idx)
{
return(__GXTlutRegionTab[idx]);
}
GXSetTlutRegionCallback( __GXGetTlutRegion ); // GXInit
GXInit, GXLoadTexObj, GXLoadTlut, GXSetTexRegionCallback, GX Default TMEM Configuration
2006/03/01 Initial version.
CONFIDENTIAL