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

# vl::Rendering Class Reference

The Rendering class collects all the information to perform the rendering of a scene. More...

`#include <Rendering.hpp>`

Inheritance diagram for vl::Rendering:

List of all members.

## Public Member Functions
virtual const char * | className ()
| Returns the name of the class.
| Rendering ()
| Constructor.
| Rendering (const Rendering &other)
| Copy constructor.
Rendering & | operator= (const Rendering &other)
| Assignment operator.
virtual void | render ()
| Executes the rendering.
void | resetStates ()
| Resets the OpenGL rendering states.
void | setRenderQueueSorter (RenderQueueSorter *render_queue_sorter)
| The RenderQueueSorter used to perform the sorting of the objects to be rendered, if NULL no sorting is performed.
RenderQueueSorter * | renderQueueSorter ()
| The RenderQueueSorter used to perform the sorting of the objects to be rendered, if NULL no sorting is performed.
void | setRenderer (Renderer *renderer)
| The Renderer object used to perform the actual rendering of the scene.
const Renderer * | renderer () const
| The Renderer object used to perform the actual rendering of the scene.
Renderer * | renderer ()
| The Renderer object used to perform the actual rendering of the scene.
void | setCamera (Camera *camera)
| The Camera that defines the point of view and viewport to be used when rendering the scene.
const Camera * | camera () const
| The Camera that defines the point of view and viewport to be used when rendering the scene.
Camera * | camera ()
| The Camera that defines the point of view and viewport to be used when rendering the scene.
Collection< SceneManager > * | sceneManagers ()
| Returns the list of SceneManager[s] containing the Actor[s] to be rendered.
const Collection< SceneManager > * | sceneManagers () const
| Returns the list of SceneManager[s] containing the Actor[s] to be rendered.
void | setRenderTarget (RenderTarget *render_target)
| The RenderTarget on which the rendering is performed.
const RenderTarget * | renderTarget () const
| The RenderTarget on which the rendering is performed.
RenderTarget * | renderTarget ()
| The RenderTarget on which the rendering is performed.
void | setTransform (Transform *transform)
| The root of the Transform tree updated at every rendering frame.
const Transform * | transform () const
| The root of the Transform tree updated at every rendering frame.
Transform * | transform ()
| The root of the Transform tree updated at every rendering frame.
void | setEvaluateLOD (bool evaluate_lod)
| Whether the Level-Of-Detail should be evaluated or not.
bool | evaluateLOD () const
| Whether the Level-Of-Detail should be evaluated or not.
void | setActorAnimationEnabled (bool animate_actors)
| Whether Actor::update() should be called or not.
bool | actorAnimationEnabled () const
| Whether Actor::update() should be called or not.
void | setShaderAnimationEnabled (bool animate_shaders)
| Whether Shader::update() should be called or not.
bool | shaderAnimationEnabled () const
| Whether Shader::update() should be called or not.
void | setCullingEnabled (bool enabled)
| Whether the installed SceneManager[s] should perform Actor culling or not in order to maximize the rendering performances.
bool | cullingEnabled () const
| Whether the installed SceneManager[s] should perform Actor culling or not in order to maximize the rendering performances.
void | setClearFlags (EClearFlags clear_flags)
EClearFlags | clearFlags () const
void | setAutomaticResourceInit (bool enable)
| Whether OpenGL resources such as textures and GLSL programs should be automatically initialized before the rendering takes place.
bool | automaticResourceInit () const
| Whether OpenGL resources such as textures and GLSL programs should be automatically initialized before the rendering takes place.
## Protected Member Functions
void | fillRenderQueue (ActorCollection *actor_list)
ActorCollection * | actorQueue ()
RenderQueue * | renderQueue ()
## Protected Attributes
ref< RenderQueueSorter > | mRenderQueueSorter
ref< ActorCollection > | mActorQueue
ref< RenderQueue > | mRenderQueue
ref< Renderer > | mRenderer
ref< RenderTarget > | mRenderTarget
ref< Camera > | mCamera
ref< Transform > | mTransform
ref< Collection< SceneManager > > | mSceneManagers
EClearFlags | mClearFlags
bool | mAutomaticResourceInit
bool | mCullingEnabled
bool | mEvaluateLOD
bool | mActorAnimationEnabled
bool | mShaderAnimationEnabled

## Detailed Description

The Rendering class collects all the information to perform the rendering of a scene.

The Rendering class performs the following steps:

1. activates the appropriate OpenGLContext
2. dispatches the RC_PreRendering RenderingCallback[s]
3. activates the RenderTarget's framebuffer and draw buffers
4. recursively computes the world matrix of the installed Transform hierarchy
5. setups the Camera transform and the Viewport
6. extracts all the visible Actor[s] from the installed SceneManager[s]
7. compiles and sorts the RenderQueue using the installed RenderQueueSorter
8. uses the installed Renderer to perform the rendering of the RenderQueue
9. dispatches the RC_PostRendering RenderingCallback[s]

To be included in the rendering an Actor must have an enableMask() and Effect::enableMask() such that `"(Actor::enableMask() & Rendering::enableMask()) != 0"` and `"(Actor::effect()->enableMask() & Rendering::enableMask()) != 0"`.

See also:

- Renderer
- Actor
- Effect
- Transform

## Constructor & Destructor Documentation

Rendering::Rendering | ( |  | ) |

Constructor.

vl::Rendering::Rendering | ( | const Rendering & | other | ) | `[inline]`

Copy constructor.

## Member Function Documentation

virtual const char* vl::Rendering::className | ( |  | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::Object.

Rendering & Rendering::operator= | ( | const Rendering & | other | ) |

Assignment operator.

void Rendering::render | ( |  | ) | `[virtual]`

Executes the rendering.

- RC_PreRendering RenderingCallback is issued right before the rendering takes place.
- RC_PostRendering RenderingCallback is issued right after the rendering is completed.

Implements vl::RenderingAbstract.

void Rendering::resetStates | ( |  | ) |

Resets the OpenGL rendering states.

void vl::Rendering::setRenderQueueSorter | ( | RenderQueueSorter * | render_queue_sorter | ) | `[inline]`

The RenderQueueSorter used to perform the sorting of the objects to be rendered, if NULL no sorting is performed.

RenderQueueSorter* vl::Rendering::renderQueueSorter | ( |  | ) | `[inline]`

The RenderQueueSorter used to perform the sorting of the objects to be rendered, if NULL no sorting is performed.

void vl::Rendering::setRenderer | ( | Renderer * | renderer | ) | `[inline]`

The Renderer object used to perform the actual rendering of the scene.

const Renderer* vl::Rendering::renderer | ( |  | ) | const`[inline]`

The Renderer object used to perform the actual rendering of the scene.

Renderer* vl::Rendering::renderer | ( |  | ) | `[inline]`

The Renderer object used to perform the actual rendering of the scene.

void vl::Rendering::setCamera | ( | Camera * | camera | ) | `[inline]`

The Camera that defines the point of view and viewport to be used when rendering the scene.

const Camera* vl::Rendering::camera | ( |  | ) | const`[inline]`

The Camera that defines the point of view and viewport to be used when rendering the scene.

Camera* vl::Rendering::camera | ( |  | ) | `[inline]`

The Camera that defines the point of view and viewport to be used when rendering the scene.

Collection<SceneManager>* vl::Rendering::sceneManagers | ( |  | ) | `[inline]`

Returns the list of SceneManager[s] containing the Actor[s] to be rendered.

const Collection<SceneManager>* vl::Rendering::sceneManagers | ( |  | ) | const`[inline]`

Returns the list of SceneManager[s] containing the Actor[s] to be rendered.

void vl::Rendering::setRenderTarget | ( | RenderTarget * | render_target | ) | `[inline]`

The RenderTarget on which the rendering is performed.

const RenderTarget* vl::Rendering::renderTarget | ( |  | ) | const`[inline]`

The RenderTarget on which the rendering is performed.

RenderTarget* vl::Rendering::renderTarget | ( |  | ) | `[inline]`

The RenderTarget on which the rendering is performed.

void vl::Rendering::setTransform | ( | Transform * | transform | ) | `[inline]`

The root of the Transform tree updated at every rendering frame.

const Transform* vl::Rendering::transform | ( |  | ) | const`[inline]`

The root of the Transform tree updated at every rendering frame.

Transform* vl::Rendering::transform | ( |  | ) | `[inline]`

The root of the Transform tree updated at every rendering frame.

void vl::Rendering::setEvaluateLOD | ( | bool | evaluate_lod | ) | `[inline]`

Whether the Level-Of-Detail should be evaluated or not.

When disabled lod #0 is used.

bool vl::Rendering::evaluateLOD | ( |  | ) | const`[inline]`

Whether the Level-Of-Detail should be evaluated or not.

When disabled lod #0 is used.

void vl::Rendering::setActorAnimationEnabled | ( | bool | animate_actors | ) | `[inline]`

Whether Actor::update() should be called or not.

Note:
  Only visible Actor[s] are updated.

bool vl::Rendering::actorAnimationEnabled | ( |  | ) | const`[inline]`

Whether Actor::update() should be called or not.

Note:
  Only visible Actor[s] are updated.

void vl::Rendering::setShaderAnimationEnabled | ( | bool | animate_shaders | ) | `[inline]`

Whether Shader::update() should be called or not.

Note:
  Only Shader[s] belonging to visible Actor[s] are updated.

bool vl::Rendering::shaderAnimationEnabled | ( |  | ) | const`[inline]`

Whether Shader::update() should be called or not.

Note:
  Only Shader[s] belonging to visible Actor[s] are updated.

void vl::Rendering::setCullingEnabled | ( | bool | enabled | ) | `[inline]`

Whether the installed SceneManager[s] should perform Actor culling or not in order to maximize the rendering performances.

bool vl::Rendering::cullingEnabled | ( |  | ) | const`[inline]`

Whether the installed SceneManager[s] should perform Actor culling or not in order to maximize the rendering performances.

void vl::Rendering::setClearFlags | ( | EClearFlags | clear_flags | ) | `[inline]`

EClearFlags vl::Rendering::clearFlags | ( |  | ) | const`[inline]`

void vl::Rendering::setAutomaticResourceInit | ( | bool | enable | ) | `[inline]`

Whether OpenGL resources such as textures and GLSL programs should be automatically initialized before the rendering takes place.

bool vl::Rendering::automaticResourceInit | ( |  | ) | const`[inline]`

Whether OpenGL resources such as textures and GLSL programs should be automatically initialized before the rendering takes place.

void Rendering::fillRenderQueue | ( | ActorCollection * | actor_list | ) | `[protected]`

ActorCollection* vl::Rendering::actorQueue | ( |  | ) | `[inline, protected]`

RenderQueue* vl::Rendering::renderQueue | ( |  | ) | `[inline, protected]`

## Member Data Documentation

ref<RenderQueueSorter> vl::Rendering::mRenderQueueSorter`[protected]`

ref<ActorCollection> vl::Rendering::mActorQueue`[protected]`

ref<RenderQueue> vl::Rendering::mRenderQueue`[protected]`

ref<Renderer> vl::Rendering::mRenderer`[protected]`

ref<RenderTarget> vl::Rendering::mRenderTarget`[protected]`

ref<Camera> vl::Rendering::mCamera`[protected]`

ref<Transform> vl::Rendering::mTransform`[protected]`

ref<Collection<SceneManager> > vl::Rendering::mSceneManagers`[protected]`

EClearFlags vl::Rendering::mClearFlags`[protected]`

bool vl::Rendering::mAutomaticResourceInit`[protected]`

bool vl::Rendering::mCullingEnabled`[protected]`

bool vl::Rendering::mEvaluateLOD`[protected]`

bool vl::Rendering::mActorAnimationEnabled`[protected]`

bool vl::Rendering::mShaderAnimationEnabled`[protected]`

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

- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/Rendering.hpp
- E:/VisualizationLibrary/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vl/Rendering.cpp

Visualization Library v2009.08 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Sun Nov 8 14:29:02 2009.
Permission is granted to use this page to write and publish articles regarding Visualization Library.