rjDrawPolygon - shaddatic/sa2b-render-fix GitHub Wiki

Prototype

void rjDrawPolygon( const NJS_POLYGON_VTX* polygon, Int count, Int trans )

API

void (*DrawPolygon)( const NJS_POLYGON_VTX* polygon, Int count, Int trans )

Ninja

void njDrawPolygon( NJS_POLYGON_VTX* polygon, Int count, Int trans )

Parameters

const NJS_POLYGON_VTX* polygon

 polygon vertex list, of length count

Int count

 Length of vertex list

Int trans

 Use translucency (TRUE/FALSE)

Returns

No return value.

Description

Draw a non-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.

#define NUM_VTX 4

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

// draw polygon
rjDrawPolygon( poly, NUM_VTX, FALSE ); // <<<<<<<<

Related Functions

History

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