Ninja Library - Texture Function

njReLoadTextureNumG

Reloads Texutres

FORMAT

Sint32 njReLoadTextureNumG( globalIndex, *texaddr, attr, lod )
Uint32 globalIndex
void *texaddr
Uint32 attr
Uint32 lod

PARAMETER

 globalIndex  Global index number 
 *texaddr  Address of either a file name or a texture memory 
 attr  Texture attribute 
 lod  Mipmap level 

RETURN

 1  Successful 
 -1  Failure 

DESCRIPTION

Reloads the texture specified by globalIndex.

Textures that can be reloaded must be the same format and size as previously loaded. When loading textures from a file, specify NJD_TEXATTR_TYPE_FILE for attr. When loading textures from a memory, specify NJD_TEXATTR_TYPE_MEMORY for attr.

Also, for mipmap textures, specifying lod allows reloading corresponding mipmap level. For example, setting 128 to lod will reload only 128x128 level mipmap textures.

Specifying 0 to lod will reload all levels of mipmap textures.

When loading from memory, it reloads from the address specified by texaddr to the level specified by lod.


EXAMPLE

Suppose
256x256 mipmap is loaded as texture #0 in the current texture list,
128x128 mipmap is loaded as texture #1 in the current texture list,
256x128 rectangle texture is loaded as texture #2 in the current texture list.
Sint8* texbuf;
texbuf = syMalloc(0x2B000);
/* When reloading from file, texture buffer is needed */
njInitTextureBuffer(texbuf,0x2B000);
/*
 Change texture #0 texture, mipmap level 128x128 to file1.pvr.
 (Here, file1.pvr is 256x256 mipmap texture.)
*/
njReLoadTextureNumG(0,"file1.pvr",NJD_TEXATTR_TYPE_FILE,128);
/*
 Reloads all the textures of texture #1.
 (Here, file2.pvr is 128x128 mipmap texture.)
*/
njReLoadTextureNumG(1,"file2.pvr",NJD_TEXATTR_TYPE_FILE,0);
/*
 Reloads all the textures of texture #2.
 (Here file3.pvr is 256x128 rectangle texture.)
*/
njReLoadTextureNumG(2,"file3.pvr",NJD_TEXATTR_TYPE_FILE,0);
syFree(texbuf);

NOTE

For memory texture, the beginning of texture target (specified by lod) must be specified . Refer to texture document for more details.

REFERENCE

njLoadTextureNum()
njReLoadTextureNum()

njReLoadTextureNumG
COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999