RenderWare V2.1

Previous Page Index Next Page

RwScene *

RwForAllLightsInScene(RwScene *scene,
RwLight *(*func) (RwLight *light));

RwScene *

RwForAllLightsInSceneInt(RwScene *scene,
RwLight *(*func) (RwLight *light, RwInt32 arg), RwInt32 arg);

RwScene *

RwForAllLightsInSceneReal(RwScene *scene,
RwLight *(*func) (RwLight *light, RwReal arg), RwReal arg);

RwScene *

RwForAllLightsInScenePointer(RwScene *scene,
RwLight *(*func)(RwLight *light, void *arg), void *arg);

Description

Applies a call-back function to all lights in the scene. If any invocation of the call-back function sets RenderWare’s error status, iteration is terminated. The call-back function can either be a RenderWare API function or a user-defined function. In the latter case, the call-back function should call RwSetUserError() if it fails for any reason.

The difference between RwForAllLightsInScene() and its variations listed above is that for RwForAllLightsInScene() the call-back function takes only one argument (a light pointer), whereas in the case of its variations, the call-back function takes an additional, user-supplied argument (arg) that can be of type RwInt32, RwReal or void * respectively.

Arguments

scene Pointer to the scene.

func Pointer to the call-back function.

arg A user-supplied argument to be passed to the call-back function.

Return Value

The argument scene if successful, and NULL otherwise.

Comments

If the return type of the call-back function is not RwLight *, then the pointer to the call-back function should be cast to the expected type, i.e., a pointer to a function whose return type is RwLight *. For example, in the case of a call-back function named foo whose return type is int, the following C expression should be used:

(RwLight*(*)())foo

See Also

RwAddLightToScene()

RwCreateLight()

RwDestroyLight()

RwForAllClumpsInScene()

RwGetSceneNumLights()

RwRemoveLightFromScene()