*polygon | Pointer for NJS_TEXTURE_VTX structure |
count | Vertex number |
tex | Texture global index |
trans | Transparent effective (TRUE), ineffective (FALSE) |
Therefore, the valid range for Z is from 1.0f to infinity.
The following draws a square. The vertex order is as follows. 1 3 2 4 NJS_TEXNAME texname[1]; NJS_TEXLIST texlist ={texname,1}; NJS_TEXMEMLIST tex[1]; NJS_TEXTURE_VTX poly[4]; Sint8 *texbuf /* Set texture initialization */ njInitTexture(tex,1); texbuf = syMalloc(0x20800); njInitTextureBuffer(texbuf,0x20800); njSetTextureName(&texname[0],"file0.pvr",0,NJD_TEXATTR_TYPE_FILE| NJD_TEXATTR_GLOBALINDEX); njLoadTexture(&texlist); syFree(texbuf); 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; /* Paste global index 0 texture on polygon */ njDrawTexture( poly, 4, 0, FALSE);