##### Ninja Library - Texture Function

# njReleaseTexture

Releases texture memory

### FORMAT

`

  Sint32 njReleaseTexture( *texlist )
  NJS_TEXLIST *texlist

`

### PARAMETER

  `*texlist` | Pointer to NJS_TEXLIST structure

### RETURN

  1 | Successful |
  -1 | Failure |

### DESCRIPTION

  Releases texture memory of texlist.

### EXAMPLE

      NJS_TEXNAME texname[2];
      NJS_TEXNAME texname2[2];
      NJS_TEXLIST texlist ={texname,2};
      NJS_TEXLIST texlist2 ={texname2,2};
      Sint8 *texbuf;
      /* Prepare to read four textures */
      NJS_TEXMEMLIST texmemlist[4];
      njInitTexture(texmemlist,4);
      texbuf = syMalloc(0x20800);
      njInitTextureBuffer(texbuf,0x20000);
      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);
      njSetTextureName(&texname2[0],"file1.pvr",0,NJD_TEXATTR_TYPE_FILE|
            NJD_TEXATTR_GLOBALINDEX);
      njSetTextureName(&texname2[1],"file3.pvr",2,NJD_TEXATTR_TYPE_FILE|
            NJD_TEXATTR_GLOBALINDEX);
      /* Load texture */
      njLoadTexture(&texlist);
      njLoadTexture(&texlist2);
      syFree(texbuf);
      /* Release the texture in texlist */
      njReleaseTexture(&texlist);
      /*
      	Even if texlist is released, since file1.pvr is in texlist2 also,
      	file.pvr will not be released from texture memory.
      	** However file1.pvr cannot be read with texlist unless it is loaded
      	again.
      */

### NOTE

  As noted above, if the texture is loaded in another texture list, the texture will not be released from texture memory unless all other occupying lists release the texture.

### REFERENCE

  `njReleaseTextureAll()
  njReleaseTextureNum()
  njReleaseTextureNumG()
  `

njReleaseTexture

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999