##### Ninja Library - Texture Function

# njRenderTextureNum

Renders texture area

### FORMAT

`

  void njRenderTextureNum( n )
  Uint32 n

`

### PARAMETER

  `n` | Texture number in the current texture list

### RETURN

  None

### DESCRIPTION

  Renders to the number n texture of the current texture list. Textures that can render are either NJD_TEXFMT_RECTANGLE or NJD_TEXFMT_STRIDE. If texture area is smaller than the screen, it adjusts to the upper left and performs rendering. Stride value must be set by `njSetRenderWidth()` funciton when NJD_TEXFMT_STRIDE. Normally, the stride value is the same as rendering area width.

### EXAMPLE

      void njUserInit(void)
      {
       /* When render texture is used, set njInitSystem frame buffer color mode
          with the texture color mode used for render texture.
       */
       sbInitSystem( NJD_RESOLUTION_640x480_NTSCNI, NJD_FRAMEBUFFER_MODE_RGB565, 1 );
      	:
       /* Reserve texture memory area with dummy  */
       buff = syMalloc(512*512*2);
       /* Set color the same as the frame buffer color, and size to 512x512 */
       njSetTextureInfo(&info,buff,NJD_TEXFMT_RECTANGLE|NJD_TEXFMT_RGB_565,512,512);
       njSetTextureName(&texname[0],&info,0,NJD_TEXATTR_TYPE_MEMORY|
                   NJD_TEXATTR_GLOBALINDEX);
       njInitTexture( tex, 100 );
       njLoadTexture(&texlist);

       /* Reserved dummy area can be released after the njLoadTexture() function  */
       syFree(buff);
      }
      Sint32 njUserMain(void)
      {
      	:

       /* Draw models etc. */
       njDrawObject( OBJECT );
      	:

       njSetTexture(&texlist);
       /* Renders to the texture number 0 */
       njRenderTextureNum(0);
       /* Draw using rendered textures */
       njDrawTexture( poly, 4, 0,TRUE);

      	:
      }

### NOTE

  Rendering to texture area means that it is totally two times to perform rendering in addtion to normal rendering to the frame buffer. Refer to texture document for more details.

### REFERENCE

  `njRenderTextureNumG()
  `

njRenderTextureNum

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999