Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics
[Home] [Tutorials] [All Classes] [Grouped Classes]

vl::ActorRenderingCallback Class Reference

The ActorRenderingCallback class defines a callback object to be executed just before an Actor is rendered but after the render states are setup. More...

#include <Actor.hpp>

Inheritance diagram for vl::ActorRenderingCallback:

vl::Object vl::DepthSortCallback vl::EdgeUpdateCallback vl::MorphingCallback

List of all members.

Public Member Functions

virtual void operator() (const Camera *cam, Actor *actor, Renderable *renderable, const Shader *shader, int pass)=0
 Called upon callback execution.


Detailed Description

The ActorRenderingCallback class defines a callback object to be executed just before an Actor is rendered but after the render states are setup.

Usually an ActorRenderingCallback is used to perform a per-Actor operation like changing some attributes of the Actor itself or of the associated Renderable/Geometry before the rendering takes place. For example you can use an ActorRenderingCallback to setup uniforms, query and save uniform binding locations, setup appropriate vertex attributes in a Geometry etc. For example the MorphingCallback class is used to aid the rendering of a MorphingActor, while the DepthSortCallback class is used to perform per-Actor polygon sorting.

Note:
An ActorRenderingCallback is called once for every rendering pass, ie. if an Actor's Effect specifies three rendering passes the Actor callbacks will be called three times, once for each rendering pass.

This function is called once for each pass, after the render states are setup, before the Actor is rendered.

If you want to update the state of a Uniform variable from here you can simply call glUniform* since the GLSLProgram (if any) has been already activated by the time this function is called. You can test whether the shader has a GLSLProgram bound to it or not by simply testing shader->glslProgram() != NULL. If you update a uniform you must ensure that all the Actor[s] using the same GLSLProgram appropriately setup such uniform.

See also:

Member Function Documentation

virtual void vl::ActorRenderingCallback::operator() ( const Camera cam,
Actor actor,
Renderable renderable,
const Shader shader,
int  pass 
) [pure virtual]

Called upon callback execution.

Parameters:
cam The camera used for the current rendering.
actor The Actor bound to this rendering callback.
renderable The currently selected Actor LOD.
shader The currently active Shader.
pass The current Actor[s] rendering pass.

Implemented in vl::DepthSortCallback, vl::EdgeUpdateCallback, and vl::MorphingCallback.


The documentation for this class was generated from the following file:

Visualization Library v2009.08 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Tue Dec 29 13:56:53 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.