RenderWare V2.1

Previous Page Index Next Page

void

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

Description

Retrieves the call-back function used to render the user-draw.

Arguments

userdraw Pointer to the user-draw.

Return Value

A pointer to the user-draw’s call-back function 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:

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()

RwEndCameraUpdate()

RwGetCameraImage()

RwGetUserDrawData()

RwSetUserDrawCallback()