GXInitLightPosv

C Specification

#include <revolution/gx.h>
#define GXInitLightPosv(lo, vec) \
(GXInitLightPos((lo), *(f32*)(vec), *((f32*)(vec)+1), *((f32*)(vec)+2)))

Arguments

lo Pointer to a light object.
vec Position vector.
You may use an array of f32 type or structure.

Return Values

None.

Description

This macro function sets the position of the light in the light object using a vector structure. The Revolution graphics hardware supports local diffuse lights. The position of the light should be in the same space as a transformed vertex position (i.e., view space).

The memory for the light object must be allocated by the application; this function does not load any hardware registers. To load a light object into a hardware light, use GXLoadLightObjImm or GXLoadLightObjIndx.

Example

You may set an array of f32 values as vec argument.

// Use an array
f32  pos[3] = { 0.0f, 0.0f, 100.0f };
GXLightObj  myLightObj;

GXInitLightPosv( &myLightObj, pos );

You can also use a structure which contains three f32 members (like Vec type of matrix-vector library).

// Use a structure
typedef structure
{
    f32  x, y, z;
} Point3d;

Point3d     pos;
GXLightObj  myLightObj;

pos.x = pos.y = pos.z = 0.0f;
GXInitLightPosv( &myLightObj, &pos );

See Also

GXInitLightPos

GXLightObj Initialization Flow

Revision History

03/01/2006 Initial version.