Ninja Library - Texture Function

njInitTexture

Sets the area used for storing texture information

FORMAT

void njInitTexture( *addr, n )
NJS_TEXMEMLIST *addr
Uint32 n

PARAMETER

 *addr  Pointer to the area holding n NJS_TEXMEMLIST structures 
 n  Number of textures to be used (In order to incorporate Nindows, add 3 to the number of textures)   

RETURN

None

DESCRIPTION

Sets the area used for storing texture information. Establishes the area for storing textures by setting addr with the pointer to the NJS structure area for holding the n textures to be used. This function must be executed before loading textures.

EXAMPLE

/* Set two textures */
NJS_TEXNAME texname[2];
NJS_TEXLIST texlist={texname,2};
/* Prepare to read two textures*/
NJS_TEXMEMLIST texmemlist[2];
texbuf = syMalloc(0x20000);
njInitTextureBuffer(texbuf,0x20000);
njInitTexture(texmemlist,2);
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);
njLoadTexture(&texlist);
syFree(texbuf);
/* Set texlist as the current texture list */
njSetTexture(&texlist);
/* Set current texture to the texlist #0 */
njSetTextureNum(0);

NOTE

The area set by this function is used internally by texture-related functions. For details, refer to the texture document.

REFERENCE

njLoadTexture()
njLoadTextureNum()

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