RenderWare V2.1

Previous Page Index Next Page

RwBool

RwForAllNamedTextures(RwTexture *(*func)(RwTexture *texture));

RwBool

RwForAllNamedTexturesInt(RwTexture *(*func)(RwTexture *texture, RwInt32 arg), RwInt32 arg);

RwBool

RwForAllNamedTexturesReal(RwTexture *(*func)(RwTexture *texture, RwReal arg), RwReal arg);

RwBool

RwForAllNamedTexturesPointer(RwTexture *(*func)(RwTexture *texture, void *arg), void *arg);

Description

Applies a call-back function to all named textures. Depending on the current search mode, the scope is either the current texture dictionary (rwLOCAL) or the entire texture dictionary stack (rwGLOBAL). 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 RwForAllNamedTextures() and its variations listed above is that for RwForAllNamedTextures() the call-back function takes only one argument (a texture 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

func Pointer to the call-back function.

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

Return Value

TRUE if successful, and FALSE otherwise.

Comments

If the return type of the call-back function is not RwTexture *, 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 RwTexture *.

For example, in the case of a call-back function named foo whose return type is int, the following C expression should be used:

RwTexture*(*)())foo

See Also

RwFindNamedTexture()

RwDestroyTexture()

RwGetNamedTexture()

RwReadNamedTexture()

RwSetTextureDictSearchMode()

RwSetUserError()

RwTextureDictBegin()

RwTextureDictEnd()