njDrawTexture Japanese
<-|INDEX|--
Draw texture polygons

FORMAT

#include <Ninja.h>
void njDrawTexture( *polygon, count, tex, trans )
NJS_POLYGON_VTX  *polygon
Int    count
Int    tex
Int    trans

PARAMETERS

*polygon
Pointer for NJS_POLYGON_VTX structure
count
Number of vertices
tex
Texture global index
trans
Translucent valid(TRUE), invalid(FALSE)

RETURN VALUE

None

FUNCTION


EXAMPLE

Draw rectangles.
Vertices order as follws:
1  3
2  4

NJS_TEXNAME texname[1];
NJS_TEXLIST texlist = {texname,1};
NJS_TEXMEMLIST  tex[1];

NJS_TEXTURE_VTX  poly[4];

/* Initializing textures*/
njInitTexture( tex,1);
njSetTextureName(&texname[0],"file0.pvr",0,NJD_TEXATTR_TYPE_FILE|
            NJD_TEXATTR_GLOBALINDEX);
njLoadTexture( &texlist );
njSetTexture( &texlist );

poly[0].x = 100.f;
poly[0].y = 100.f;
poly[0].z = 0.5f;
poly[0].u = 0.f;
poly[0].v = 0.f;
poly[0].col = 0xFFFFFFFF;

poly[1].x = 100.f;
poly[1].y = 300.f;
poly[1].z = 0.5.f;
poly[1].u = 0.f;
poly[1].v = 1.f;
poly[1].col = 0xFFFFFFFF;

poly[2].x = 300.f;
poly[2].y = 100.f;
poly[2].z = 0.5f;
poly[2].u = 1.f;
poly[2].v = 0.f;
poly[2].col = 0xFFFFFFFF;

poly[3].x = 300.f;
poly[3].y = 300.f;
poly[3].z = 0.5f;
poly[3].u = 1.f;
poly[3].v = 1.f;
poly[3].col = 0xFFFFFFFF;

/* Map the texture of global index #0 to polygon */
njDrawTexture( poly, 4, 0, FALSE);

NOTES


RELATED TOPICS

njDrawPolygon

njDrawTexture
<-|INDEX|--

Copyright SEGA ENTERPRISES, LTD., 1997