Instead of elaborate memory recovery mechanisms, it is sometimes easier to download textures until there is no more room, then clear texture memory and start over with new textures. For example, a game with obvious breaks between levels can avoid complex texture memory management by clearing out texture memory whenever the player enters a new “level”. To reset the texture memory, call guTexMemReset(). After guTexMemReset() is called, all texture map handles associated with the reset Voodoo Graphics subsystem are invalidated.
void guTexMemReset( void )
6Downloading Textures
After the memory has been allocated, guTexDownloadMipMap() and guTexDownloadMipMapLevel() can be used to download complete mipmaps or individual levels, respectively.
void guTexDownloadMipMap(GrMipMapId_t mipmapID, const void *src, const GuNccTable *NCCtable)
guTexDownloadMipMap() downloads an entire mipmap to an area of texture memory previously allocated with guTexAllocateMemory() and pointed to by mipmapID. The data to be downloaded must have the pixel format and aspect ratio associated with mipmapID. If the texture uses an NCC decompression table, NCCtable is a pointer to it. This is only valid for 8-bit compressed textures loaded with gu3dfLoad().
void guTexDownloadMipMapLevel(GrMipMapId_t mipmapID, GrLOD_t lod, const void **src )
guTexDownloadMipMapLevel() downloads a single mipmap level within a mipmap to an area of texture memory previously allocated with guTexAllocateMemory()and updates *src to point to the next mipmap level. The data to be downloaded must be of the same pixel format and aspect ratio as mipmapID and must be of the correct size for lod, the LOD that is being downloaded.
guTexSource makes current a mipmap for the TMU it resides on. Each TMU has one current mipmap. In systems with multiple TMUs, multiple mipmap sources are combined by the texture combine function and the output of the final combine is passed on to the pixel shading pipeline. By default, all the TMUs have null texture handles associated with them.
void guTexSource(GrMipMapId_t mipmapID)