Visualization Library

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

vl::ProjViewTranfCallbackStandard Class Reference

Updates the GL_MODELVIEW and GL_PROJECTION matrices of the fixed function pipeline in an optimized manner. More...

#include <Renderer.hpp>

Inheritance diagram for vl::ProjViewTranfCallbackStandard:
vl::ProjViewTranfCallback vl::Object

List of all members.

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.

Detailed Description

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!


Constructor & Destructor Documentation

vl::ProjViewTranfCallbackStandard::ProjViewTranfCallbackStandard (  ) [inline]

Member Function Documentation

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.

Parameters:
callerThe Renderer object calling this function.
glslThe GLSLProgram being activated. If NULL the fixed function pipeline is being activated.
transformThe transform of the current Actor being rendered.
cameraThe Camera used for the rendering from which you can retrieve the projection and view matrices.
first_overallIf 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.

Parameters:
callerThe Renderer object calling this function.
glslThe GLSLProgram being activated. If NULL the fixed function pipeline is being activated.
transformThe transform of the current Actor being rendered.
cameraThe Camera used for the rendering from which you can retrieve the projection and view matrices.

Implements vl::ProjViewTranfCallback.


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

Visualization Library v2010.11.1123 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Thu Nov 18 2010 02:08:12.
Permission is granted to use this page to write and publish articles regarding Visualization Library.