rjDrawTexture - shaddatic/sa2b-render-fix GitHub Wiki

Prototype

void rjDrawTexture( const NJS_TEXTURE_VTX* polygon, Int count, Int tex, Int flag )

API

void (*DrawTexture)( const NJS_TEXTURE_VTX* polygon, Int count, Int tex, Int flag )

Ninja

void njDrawTexture( NJS_TEXTURE_VTX* polygon, Int count, Int tex, Int flag )

Parameters

const NJS_TEXTURE_VTX* polygon

 polygon vertex list, of length count

Int count

 Length of vertex list

Int tex

 Texture GBIX value

Int trans

 Use translucency (TRUE/FALSE)

Returns

No return value.

Description

Draw a textured polygon with 'n' vertexes in hardware units.

The vertex list is in triangle strip format.

Example

This example will draw a 64x64, opaque, multi-colored polygon in the center of the screen at half depth. It will use a texture with a GBIX value of 1000.

#define NUM_VTX 4
#define GBIX 1000

// set vertex list
NJS_TEXTURE_VTX poly[NUM_VTX] = 
{
    // x,    y,     z,    u,   v,   col (ARGB)
    { 288.f, 208.f, 0.5f, 0.f, 0,f, 0xFFFFFFFF }, // top left, white
    { 288.f, 272.f, 0.5f, 0.f, 1,f, 0xFFFF0000 }, // bottom left, red
    { 352.f, 208.f, 0.5f, 1.f, 0,f, 0xFF00FF00 }, // top right, green
    { 352.f, 272.f, 0.5f, 1.f, 1,f, 0xFF0000FF }, // bottom right, blue
};

// draw polygon
rjDrawTexture( poly, NUM_VTX, GBIX, FALSE ); // <<<<<<<<

Related Functions

History

  • 1.5.0.0:
    • Introduced to the 'Ninja Draw' API module