RenderWare V2.1

Previous Page Index Next Page

RwClump *

RwForAllUserDrawsInClump(RwClump *clump,
RwUserDraw *(*func)(RwUserDraw *userdraw));

RwClump *

RwForAllUserDrawsInClumpInt(RwClump *clump,
RwUserDraw *(*func)(RwUserDraw *userdraw, RwInt32 arg),
RwInt32 arg);

RwClump *

RwForAllUserDrawsInClumpReal(RwClump *clump,
RwUserDraw *(*func)(RwUserDraw *userdraw, RwReal arg),
RwReal arg);

RwClump *

RwForAllUserDrawsInClumpPointer(RwClump *clump,
RwUserDraw *(*func)(RwUserDraw *userdraw, void *arg),
void *arg);

Description

Applies a call-back function to all user-draws belonging to a given clump. 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 RwForAllUserDrawsInClump() and its variations listed above is that for RwForAllUserDrawsInClump() the call-back function takes only one argument (a user-draw 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

clump Pointer to the clump.

func Pointer to the call-back function.

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

Return Value

The argument clump if successful, and NULL otherwise.

Comments

If the return type of the call-back function is not RwUserDraw *, 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 RwUserDraw *. For example, in the case of a call-back function named foo whose return type is int, the following C expression should be used:

(RwUserDraw*(*)())foo

See Also

RwAddUserDrawToClump()

RwDuplicateUserDraw()

RwGetClumpNumUserDraws()

RwRemoveUserDrawFromClump()

RwSetUserError()