rjDrawTextureH - shaddatic/sa2b-render-fix GitHub Wiki

Prototype

void rjDrawTextureH( const NJS_TEXTUREH_VTX* polygon, Int count, Int tex, Int flag )

API

void (*DrawTextureH)( const NJS_TEXTUREH_VTX* polygon, Int count, Int tex, Int flag )

Ninja

void njDrawTextureH( NJS_TEXTUREH_VTX* polygon, Int count, Int tex, Int flag )

Parameters

const NJS_TEXTUREH_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 with a highlight color.

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 and a white highlight color on it's right edge.

#define NUM_VTX 4
#define GBIX 1000

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

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

Related Functions

History