rjDrawQuadTexture - shaddatic/sa2b-render-fix GitHub Wiki

Prototype

void rjDrawQuadTexture( const NJS_QUAD_TEXTURE* q, Float z )

API

void (*DrawQuadTexture)( const NJS_QUAD_TEXTURE* q, Float z )

Ninja

void njDrawQuadTexture( NJS_QUAD_TEXTURE* q, Float z )

Parameters

const NJS_QUAD_TEXTURE* q

 Rectangle quad texture structure

Float z

 Quad depth

Returns

No return value.

Description

Draw a basic, rectangle quad texture in hardware units.

Example

This example will draw a 64x64, opaque, rectangle quad texture in the center of the screen at half depth. It will use texture index of 0 in a defined texlist.

#define NUM_TEX 0
#define QUAD_COLOR 0xFFFFFFFF

// set vertex list
NJS_QUAD_TEXTURE q = 
{
    // top left vertex
    .x1 = 288.f,
    .y1 = 208.f,
   
    // bottom right vertex
    .x2 = 352.f,
    .y2 = 272.f,

    // top left texture
    .u1 = 0.f,
    .v1 = 0.f,

    // bottom right texture
    .u2 = 1.f,
    .v2 = 1.f,
};

// set the texture list
rjSetTexture( &texlist );

// start draw, not translucent
rjQuadTextureStart( FALSE );

// set color + texture
rjSetQuadTexture( NUM_TEX, QUAD_COLOR );

// draw quad
rjDrawQuadTexture( &q, 0.5f ); // <<<<<<<<

// ... optionally draw more quads

// end draw
rjQuadTextureEnd();

Related Functions

History