##### Ninja Library - Texture Function

# njInitCacheTextureBuffer

Sets a cache texture buffer

### FORMAT

`

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

`

### PARAMETER

  `*addr` | Head pointer to cache texture buffer
  `size` | Cache texture buffer size

### RETURN

  None

### DESCRIPTION

  Sets necesarry memory for cache texture. The memory which is set here is necessary while using cache texture.

### EXAMPLE

      NJS_TEXNAME texname[5];
      NJS_TEXLIST texlist={texname,5};
      /* Prepare to read two textures */
      NJS_TEXMEMLIST texmemlist[2];
      Sint8 *texbuf;
      Sint8 *cachebuf;
      njInitTexture(texmemlist,2);
      texbuf = syMalloc(0x20800);
      njInitTextureBuffer(texbuf,0x20000);
      /*
      	Set cache buffer 256x256x2bytex2=0x40000
      	Needs enough memory for texture data.
      */
      cachebuf = syMalloc(0x40000);
      njInitCacheTextureBuffer(cachebuf,0x40000);
      /* Specify to read file into cache */
      njSetTextureName(&texname[0],"file1.pvr",0,NJD_TEXATTR_TYPE_FILE|
          NJD_TEXTURE_CACHE|NJD_TEXATTR_GLOBALINDEX);
      /* Specify to read file into cache */
      njSetTextureName(&texname[1],"file2.pvr",1,NJD_TEXATTR_TYPE_FILE|
          NJD_TEXTURE_CACHE|NJD_TEXATTR_GLOBALINDEX);
      /* Load texture into cache */
      njLoadTexture(&texlist);
      syFree(texbuf);
      /* Set texlistas the current texture list */
      njSetTexture(&texlist);
      /* Read texture from cache into texture memory */
      njLoadCacheTexture(&texlist);
      /* Set current texture as textlist #0  file1.pvr*/
      njSetTextureNum(0);
          :
      /* lit. Drawing texture with texture in file1.pvr */
          :

njInitCacheTextureBuffer

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999