##### Ninja Library - Texture Function

# njSetTexture

Sets current texture list

### FORMAT

`

  Sint32 njSetTexture( *texlist )
  NJS_TEXLIST *texlist

`

### PARAMETER

  `*texlist` | Pointer to NJS_TEXLIST structure

### RETURN

  1 | Succeeded |
  -1 | Failed |

### DESCRIPTION

  Sets texlist as the curent texture list.

### EXAMPLE

      NJS_TEXNAME texname[2];
      NJS_TEXNAME texname2[2];
      NJS_TEXLIST texlist ={texname,2};
      NJS_TEXLIST texlist ={texname2,2};
      Sint8 *texbuf;
      /* Prepare to read three textures */
      NJS_TEXMEMLIST texmemlist[3];
      njInitTexture(texmemlist,3);
      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",1,NJD_TEXATTR_TYPE_FILE|
            NJD_TEXATTR_GLOBALINDEX);
      /* Load texture */
      njLoadTexture(&texlist);
      syFree(texbuf);
      /* Load texture */
      njLoadTexture(&texlist2);
      /* Set current texture list to texlist */
      /* No problem if it's done prior to executing njLoadTexture() function */
      njSetTexture(&texlist);
      /* Set current texture as #0 texture in texlist  file1.pvr*/
      njSetTextureNum(0);
          :
      /* lit. Drawing textures using file1.pvr */
          :
      /* Set texlist2 as the current texture list */
      njSetTexture(&texlist2);
      /* Set current texture to texlist2 #1 texture  file3.pvr */
      njSetTextureNum(1);
          :
      /* lit. Drawing textures  using file3.pvr */
          :

### NOTE

  Current texture list won't be changed until next time `njSetTexturen()` function is executed. All texture related functions such as `njXXXXNum()` and `njXXXXNumG()` will work with current texture list. Refer to texture document for more details.

### REFERENCE

  `njSetTextureNum()
  njSetTextureNumG()
  `

njSetTexture

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999