BRender Technical Reference Manual:4 Data Structures (Alphabetical Reference):br_renderbounds_cbfn
Next|Prev|Up
The Call-Back Function
Specification
CBFnRenderBounds()
Operations

br_renderbounds_cbfn


The Call-Back Function

This type defines a call-back function, which can be specified by using the function Br[Zb|Zs]RenderBoundsCallbackSet()
38|38. It is called for each rendered model actor in the actor hierarchies supplied to Br[Zb|Zs]SceneRender()34|34 and Br[Zb|Zs]SceneRenderAdd()36|37 (it may also be called by Br[Zb|Zs]ModelRender()249|249). It enables an application to perform extra rendering for particular actors, or to perform computations that require information only obtainable just after a model actor has been processed by the rendering engine.

The typedef

(See zbproto.h for a precise declaration)

void br_renderbounds_cbfn(br_actor*, const br_model*, const br_material*, void*, br_uint_8, const br_matrix4*, const br_int_32 [4]) Render bounds call-back

Related Functions

For details of how to specify that a render bounds call-back function should be called during rendering see Br[Zb|Zs]RenderBoundsCallbackSet()38|38.

Functions dedicated for use within rendering call-backs: Br[Zb|Zs]ModelRender()249|249, BrOnScreenCheck()249, BrOriginToScreenXY()251, BrPointToScreenXY()251, BrPointToScreenXYMany()251, BrOriginToScreenXYZO()252, BrPointToScreenXYZO()252, BrPointToScreenXYZOMany()253.

Related Structures

See br_model_custom_cbfn247 for a substitute model rendering call-back.

Specification


CBFnRenderBounds()

Description:
An application defined call-back function that is called for each rendered model, at some point during rendering - at precisely what point is undefined, except that its parents have been processed (though not necessarily rendered). The pass through equivalent for this call-back is to do nothing. The function may call any non-rendering functions available to a model's custom call-back function - see br_model_custom_cbfn
247.

Declaration:
void BR_CALLBACK CBFnRenderBounds(br_actor* actor, const br_model* model, const br_material* material, void* render_data, br_uint_8 style, const br_matrix4* model_to_screen, const br_int_32 bounds[4])

Arguments:
br_actor * actor

Pointer to model actor referencing the model.

const br_model * model

Pointer to a model that has affected the rendering.

const br_material * material

Pointer to actor's material if defined, or default material otherwise.

void * render_data

If the function is called during a rendering performed by the Z-Sort renderer this will point to the order table into which the model actor's primitives have been inserted.

br_uint_8 style

Actor's rendering style, or default. BRender will not supply BR_RSTYLE_BOUNDING_- or BR_RSTYLE_NONE.

const br_matrix4 * model_to_screen

A pointer to a matrix giving the model to screen transformation.

const br_int_32 bounds[4]

An array containing minimum and maximum screen ordinates of pixels that would be modified in the process of rendering the model. Use the following symbols to obtain each ordinate:

Preconditions:
BRender has completed initialisation. Rendering is in progress. The rendering engine has determined that the model will affect pixels in the output buffers.

Effects:
Behaviour is up to the application. Any of the operations described for br_model_custom_cbfn
247 can be used except Br[Zb|Zs]ModelRender()249|249.

Remarks:
This function may also be called as a result of calling Br[Zb|Zs]ModelRender()249|249, so if you are highlighting a model's edges say, be careful that you don't accidentally over recurse.

Any other BRender functions may be called from within this call-back with the following restrictions:

Example:
Possible uses include:

Note that a suitable call to clear the area of a pixel map for the purpose of clearing dirty rectangles only, is as follows:


BrPixelmapDirtyRectangleFill
(	pixel_map
,	bounds[BR_BOUNDS_MIN_X]
,	bounds[BR_BOUNDS_MIN_Y]
,	bounds[BR_BOUNDS_MAX_X]-bounds[BR_BOUNDS_MIN_X]+1L
,	bounds[BR_BOUNDS_MAX_Y]-bounds[BR_BOUNDS_MIN_Y]+1L
,	0
)

See Also:
br_model_custom_cbfn247, br_primitive_cbfn307, br_pick2d_cbfn268, br_pick3d_cbfn270.


Operations

The following functions are provided solely for use within CBFnModelCustom()
247, CBFnPrimitive()307 and CBFnRenderBounds()307 functions (see br_model_custom_cbfn247).


Generated with CERN WebMaker