RenderWare V2.1

Previous Page Index Next Page

RwClump *

RwForAllPolygonsInClump(RwClump *clump,
RwPolygon3d *(*func)(RwPolygon3d *polygon));

RwClump *

RwForAllPolygonsInClumpInt(RwClump *clump,
RwPolygon3d *(*func)(RwPolygon3d *polygon, RwInt32 arg),
RwInt32 arg);

RwClump *

RwForAllPolygonsInClumpReal(RwClump *clump,
RwPolygon3d *(*func)(RwPolygon3d *polygon, RwReal arg),
RwReal arg);

RwClump *

RwForAllPolygonsInClumpPointer(RwClump *clump,
RwPolygon3d *(*func)(RwPolygon3d *polygon, void *arg),
void *arg);

Description

Applies a call-back function to all polygons 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 RwForAllPolygonsInClump() and its variations listed above is that for RwForAllPolygonsInClump() the call-back function takes only one argument (a polygon 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 RwPolygon3d *, 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 RwPolygon3d *. For example, in the case of a call-back function named foo whose return type is int, the following C expression should be used:

(RwPolygon3d*(*)()) foo

See Also

RwAddPolygonToClump()

RwAddPolygonsToClump()

RwFindTaggedPolygon()

RwGetClumpNumPolygons()

RwPolygon()

RwPolygonExt()

RwQuad()

RwQuadExt()

RwSetUserError()

RwTriangle()

RwTriangleExt()