Visualization LibraryA lightweight C++ OpenGL middleware for 2D/3D graphics |
[Home] [Tutorials] [All Classes] [Grouped Classes] |
Updates the GL_MODELVIEW and GL_PROJECTION matrices of the fixed function pipeline in an optimized manner. More...
#include <Renderer.hpp>
Public Member Functions | |
| ProjViewTranfCallbackStandard () | |
| virtual void | programFirstUse (const Renderer *, const GLSLProgram *glsl, const Transform *, const Camera *, bool first_overall) |
| This function is called whenever a new GLSLProgram (or the NULL one, i.e. | |
| virtual void | programTransfChange (const Renderer *, const GLSLProgram *glsl, const Transform *, const Camera *) |
| This function is called whenever the Transform changes with respect to the current GLSLProgram (including the NULL one, i.e. | |
Updates the GL_MODELVIEW and GL_PROJECTION matrices of the fixed function pipeline in an optimized manner.
You usually want to install this callback if the fixed fuction pipeline is available, even when using GLSL shaders. In fact the GL_MODELVIEW and GL_PROJECTION matrices are visible from all the GLSL shaders, thus requiring fewer matrix updates compared to being forced to send projection, view and transform matrix to every single GLSLProgram at least once during the rendering!
| vl::ProjViewTranfCallbackStandard::ProjViewTranfCallbackStandard | ( | ) | [inline] |
| void ProjViewTranfCallbackStandard::programFirstUse | ( | const Renderer * | caller, |
| const GLSLProgram * | glsl, | ||
| const Transform * | transform, | ||
| const Camera * | camera, | ||
| bool | first_overall | ||
| ) | [virtual] |
This function is called whenever a new GLSLProgram (or the NULL one, i.e.
the fixed function pipeline) is being activated for the first time in the current rendering. This callback is most useful to initialize the GLSLProgram with the current projection and view matrices, besides the current Actor's transform.
| caller | The Renderer object calling this function. |
| glsl | The GLSLProgram being activated. If NULL the fixed function pipeline is being activated. |
| transform | The transform of the current Actor being rendered. |
| camera | The Camera used for the rendering from which you can retrieve the projection and view matrices. |
| first_overall | If true it means that the rendering has just started. Useful if you want to initialized your callback object. |
Implements vl::ProjViewTranfCallback.
| void ProjViewTranfCallbackStandard::programTransfChange | ( | const Renderer * | caller, |
| const GLSLProgram * | glsl, | ||
| const Transform * | transform, | ||
| const Camera * | camera | ||
| ) | [virtual] |
This function is called whenever the Transform changes with respect to the current GLSLProgram (including the NULL one, i.e.
the fixed function pipeline). This callback is most useful to update the GLSLProgram with the current Actor's transform matrix.
| caller | The Renderer object calling this function. |
| glsl | The GLSLProgram being activated. If NULL the fixed function pipeline is being activated. |
| transform | The transform of the current Actor being rendered. |
| camera | The Camera used for the rendering from which you can retrieve the projection and view matrices. |
Implements vl::ProjViewTranfCallback.