RenderWare V2.1

Previous Page Index Next Page

RwUserDraw *

RwSetUserDrawCallback(RwUserDraw *userdraw,
void (*callback)(RwUserDraw *userdraw, void *camimage,
RwRect *rect, void *data));

Description

Sets the call-back function that renders the user-draw.

Arguments

userdraw Pointer to the user-draw.

callback Pointer to the call-back rendering function.

Return Value

The argument userdraw if successful, and NULL otherwise.

Comments

User-draw call-backs should be declared as follows:

void callback(RwUserDraw *userdraw, void *camimage,
RwRect *rect, void *data);

Where the call-back’s arguments are as follows:

userdraw Pointer to the user-draw to be rendered.

camimage The camera’s image buffer as returned by RwGetCameraImage() for the current camera. camimage is device dependent. For more information, see Appendix B.

rect Pointer to a rectangle defining the area of the camera’s image buffer into which the call-back may render. This rectangle is specified in viewport space coordinates, i.e., (0, 0) is the origin of the viewport.

data Pointer to the user data of the user-draw being drawn. This value can be obtained by calling RwGetUserDrawData() with userdraw as an argument. data is passed directly to the call-back function for the convenience of the application developer.

Note that the call-back function is always called after all clumps in the scene have been rendered, i.e., when RwEndCameraUpdate() is called. Therefore user-draw rendering always appear in front of clump rendering. In the case of overlapping user-draws, the order of rendering is not defined.

See Also

RwCreateUserDraw()

RwGetCameraImage()

RwGetUserDrawCallback()

RwGetUserDrawData()