##### Ninja Library - Texture Function

# njInitTextureBuffer

Sets necessary memory for work area of a texture

### FORMAT

`

  void njInitTextureBuffer( *addr,size )
  Sint8 *addr
  Uint32 size

`

### PARAMETER

  `*addr` | Head pointer of work buffer
  `size` | Work buffer size

### RETURN

  None

### DESCRIPTION

  Specifies buffer larger than 2048 bytes or 2048 byte unit. If buffer is 32 byte alignment, DMA is used. The following functions use texture buffer.

  njLoadTexture()
  njLoadTextureNum()
  njReLoadTextureNum()
  njReLoadTextureNumG()

  Memory specified here can be freed after the execution of function. Specifying bigger size makes the period of execution shorter as number of loads from GD gets less. For details, refer to the texture document.

### EXAMPLE

      NJS_TEXNAME texname[2];
      NJS_TEXLIST texlist ={texname,2};
      /* Prepare to read two textures */
      NJS_TEXMEMLIST texmemlist[2];
      Sint8 *texbuf;
      njInitTexture(texmemlist,2);
      /* Specify buffer of 4996 bytes */
      texbuf = syMalloc(4096);
      njInitTextureBuffer(texbuf,4096);
      /* Set 2 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);
      /* Load texture */
      njLoadTexture(&texlist);
      /* After loading, the buffer can be freed */
      syFree(texbuf);

njInitTextureBuffer

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999