##### Ninja Library - Texture Function

# njSetTextureNumG

Sets the current texture to a global index number

### FORMAT

`

  Sint32 njSetTextureNumG( globalIndex )
  Uint32 globalIndex

`

### PARAMETER

  `globalIndex` | Global index number

### RETURN

  1 | Succeeded |
  -1 | Failed |

### DESCRIPTION

  Sets the texture identified by global index number globalIndex as the current texture. Subsequently, this remains the current texture until execution of `njSetTextureNum()` or `njSetTextureNumG()` function.

### EXAMPLE

      NJS_TEXNAME texname[2];
      NJS_TEXNAME texname2[2];
      NJS_TEXLIST texlist ={texname,2};
      NJS_TEXLIST texlist2 ={texname2,2};
      /* Prepare to load a total of 4 textures */
      NJS_TEXMEMLIST texmemlist[4];
      Sint8 *texbuf;
      njInitTexture(texmemlist,4);
      texbuf = syMalloc(0x20800);
      njInitTextureBuffer(texbuf,0x20000);
      njSetTextureName(&texname[0],"file1.pvr",100,NJD_TEXATTR_TYPE_FILE|
            NJD_TEXATTR_GLOBALINDEX);
      njSetTextureName(&texname[1],"file2.pvr",200,NJD_TEXATTR_TYPE_FILE|
            NJD_TEXATTR_GLOBALINDEX);
      njSetTextureName(&texname2[0],"file3.pvr",300,NJD_TEXATTR_TYPE_FILE|
            NJD_TEXATTR_GLOBALINDEX);
      njSetTextureName(&texname2[1],"file4.pvr",400,NJD_TEXATTR_TYPE_FILE|
            NJD_TEXATTR_GLOBALINDEX);
      /* Load texture */
      njLoadTexture(&texlist);
      /* Load texture */
      njLoadTexture(&texlist2);
      syFree(texbuf);
      /* Set global index #100 texture as the current texture file1.pvr */
      njSetTextureNumG(100);
          :
      /* lit. Drawing texture using texture of file1.pvr */
          :
      /* Set the 3rd texture in global index as the current texture file4.pvr */
      njSetTextureNumG(400);
          :
      /* lit. Drawing texture using texture of file4.pvr */
          :

### NOTE

  The specified texture must be present in texture memory. Refer to texture document for more details.

### REFERENCE

  `njSetTexture()
  njSetTextureNum()
  `

njSetTextureNumG

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999