Ninja Library - Texture Function

njLoadTextureNum

Loads textures

FORMAT

Sint32 njLoadTextureNum( n )
Uint32 n

PARAMETER

 n  Texture number in the current texture list 

RETURN

 1  Successful 
 -1  Failed 

DESCRIPTION

Loads the number n texture in the current texture list into either texture memory or cache memory.

EXAMPLE

/* Set two textures */
NJS_TEXMEMLIST texmemlist[2];
Sint8 *texbuf;
njInitTexture(texmemlist,2);
texbuf = syMalloc(0x20800);
njInitTextureBuffer(texbuf,0x20000);
/* Set the two textures */
njSetTextureName(&texname[0],"file1.pvr",0,NJD_TEXATTR_TYPE_FILE|
      NJD_TEXATTR_GLOBALINDEX);
njSetTextureName(&texname[1],"file2.pvr",1,NJD_TEXATTR_TYPE_FILE|
      NJD_TEXATTR_GLOBALINDEX);
/* Set texlist as the current testure list */
/* This must be done first */
njSetTexture(&texlist);
/* Load texture #0  file1.pvr */
njLoadTextureNum(0);
/* Load texture #1  file2.pvr */
njLoadTextureNum(1);
syFree(texbuf);
/* Set current texture as texture #0 in the texlist */
njSetTextureNum(0);

NOTE

njInitTexture() and njSetTexture() functions must be executed prior to executing this function. For details, refer to texture document.

REFERENCE

njInitTexture()
njLoadTexture()

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