Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
#include <Actor.hpp>

Public Member Functions | |
| virtual void | operator() (const Camera *cam, Actor *actor, Renderable *renderable, const Shader *shader, int pass)=0 |
| Called upon callback execution. | |
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.
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.
| virtual void vl::ActorRenderingCallback::operator() | ( | const Camera * | cam, | |
| Actor * | actor, | |||
| Renderable * | renderable, | |||
| const Shader * | shader, | |||
| int | pass | |||
| ) | [pure virtual] |
Called upon callback execution.
| 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.