Visualization Library 2.1.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
The Renderer class executes the actual rendering on the given RenderQueue. More...
#include <Renderer.hpp>
Public Member Functions | |
Renderer () | |
virtual | ~Renderer () |
virtual const RenderQueue * | render (const RenderQueue *in_render_queue, Camera *camera, real frame_clock) |
Takes as input the render queue to render and returns a possibly filtered render queue for further processing. More... | |
const RenderQueue * | renderRaw (const RenderQueue *in_render_queue, Camera *camera, real frame_clock) |
Used by render() to loop through the render queue. More... | |
void | setProjViewTransfCallback (ProjViewTransfCallback *callback) |
const ProjViewTransfCallback * | projViewTransfCallback () const |
ProjViewTransfCallback * | projViewTransfCallback () |
const std::map< unsigned int, ref< Shader > > & | shaderOverrideMask () const |
A bitmask/Shader map used to everride the Shader of those Actors whose enable mask satisfy the following condition: (Actors::enableMask() & bitmask) != 0. More... | |
std::map< unsigned int, ref< Shader > > & | shaderOverrideMask () |
A bitmask/Shader map used to everride the Shader of those Actors whose enable mask satisfy the following condition: (Actors::enableMask() & bitmask) != 0. More... | |
std::vector< RenderStateSlot > & | overriddenDefaultRenderStates () |
Render states that will be used as default by the opengl context by this renderer. More... | |
const std::vector< RenderStateSlot > & | overriddenDefaultRenderStates () const |
Render states that will be used as default by the opengl context by this renderer. More... | |
bool | isEnabled (unsigned int mask) |
bool | isEnabled (const Actor *actor) |
void | setFramebuffer (FramebufferObject *framebuffer) |
The Framebuffer on which the rendering is performed. More... | |
const FramebufferObject * | framebuffer () const |
The Framebuffer on which the rendering is performed. More... | |
FramebufferObject * | framebuffer () |
The Framebuffer on which the rendering is performed. More... | |
Public Member Functions inherited from vl::RendererAbstract | |
RendererAbstract () | |
RendererAbstract & | operator= (const RendererAbstract &other) |
void | dispatchOnRendererStarted () |
Dispatches the onRendererStarted() event to the registered RenderEventCallback objects. More... | |
void | dispatchOnRendererFinished () |
Dispatches the onRendererFinished() event to the registered RenderEventCallback objects. More... | |
Collection< RenderEventCallback > * | onFinishedCallbacks () |
Returns the list of RenderEventCallback objects registered to onRendererFinished() event notification. More... | |
const Collection< RenderEventCallback > * | onFinishedCallbacks () const |
Returns the list of RenderEventCallback objects registered to onRendererFinished() event notification. More... | |
Collection< RenderEventCallback > * | onStartedCallbacks () |
Returns the list of RenderEventCallback objects registered to onRendererStarted() event notification. More... | |
const Collection< RenderEventCallback > * | onStartedCallbacks () const |
Returns the list of RenderEventCallback objects registered to onRendererStarted() event notification. More... | |
unsigned long | renderTick () const |
The current render tick number, equivalent to the number or calls made to the render() method. More... | |
void | incrementRenderTick () |
Increments the rendering tick count. More... | |
void | setClearFlags (EClearFlags clear_flags) |
The clear flags used to clear the viewport. More... | |
EClearFlags | clearFlags () const |
The clear flags used to clear the viewport. More... | |
void | setEnableMask (unsigned int mask) |
Enable mask used to enable/disable the rendering of matching Actors. More... | |
unsigned int | enableMask () const |
Enable mask used to enable/disable the rendering of matching Actors. More... | |
void | setFrameClock (real t) |
The current rendring frame time. More... | |
real | frameClock () const |
The current rendring frame time. More... | |
Public Member Functions inherited from vl::Object | |
Object () | |
Constructor. More... | |
Object (const Object &other) | |
Copy constructor: copies the name, ref count mutex and user data. More... | |
Object & | operator= (const Object &other) |
Copy operator: copies the object's name, ref count mutex and user data. More... | |
const std::string & | objectName () const |
The name of the object, by default set to the object's class name. More... | |
void | setObjectName (const char *name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setObjectName (const std::string &name) |
The name of the object, by default set to the object's class name in debug builds. More... | |
void | setRefCountMutex (IMutex *mutex) |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
IMutex * | refCountMutex () |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
const IMutex * | refCountMutex () const |
The mutex used to protect the reference counting of an Object across multiple threads. More... | |
int | referenceCount () const |
Returns the number of references of an object. More... | |
void | incReference () const |
Increments the reference count of an object. More... | |
void | decReference () |
Decrements the reference count of an object and deletes it if both automaticDelete() is true the count reaches 0. More... | |
void | setAutomaticDelete (bool autodel_on) |
If set to true the Object is deleted when its reference count reaches 0. More... | |
bool | automaticDelete () const |
If set to true the Object is deleted when its reference count reaches 0. More... | |
template<class T > | |
T * | as () |
Casts an Object to the specified class. More... | |
template<class T > | |
const T * | as () const |
Casts an Object to the specified class. More... | |
Protected Attributes | |
ref< FramebufferObject > | mFramebuffer |
vl::ref< EnableSet > | mDummyEnables |
vl::ref< RenderStateSet > | mDummyStateSet |
std::map< unsigned int, ref< Shader > > | mShaderOverrideMask |
std::vector< RenderStateSlot > | mOverriddenDefaultRenderStates |
ref< ProjViewTransfCallback > | mProjViewTransfCallback |
Protected Attributes inherited from vl::RendererAbstract | |
ref< Collection< RenderEventCallback > > | mOnFinishedCallbacks |
ref< Collection< RenderEventCallback > > | mOnStartedCallbacks |
unsigned long | mRenderTick |
unsigned int | mEnableMask |
EClearFlags | mClearFlags |
real | mFrameClock |
Protected Attributes inherited from vl::Object | |
std::string | mObjectName |
IMutex * | mRefCountMutex |
int | mReferenceCount |
bool | mAutomaticDelete |
Additional Inherited Members | |
Protected Member Functions inherited from vl::Object | |
virtual | ~Object () |
The Renderer class executes the actual rendering on the given RenderQueue.
Definition at line 49 of file Renderer.hpp.
Renderer::Renderer | ( | ) |
Definition at line 46 of file Renderer.cpp.
References mDummyEnables, mDummyStateSet, mProjViewTransfCallback, and NULL.
|
inlinevirtual |
Definition at line 56 of file Renderer.hpp.
|
inlinevirtual |
The Framebuffer on which the rendering is performed.
Implements vl::RendererAbstract.
Definition at line 100 of file Renderer.hpp.
Referenced by render(), vl::EdgeRenderer::render(), vl::EdgeRenderer::renderLines(), renderRaw(), vl::EdgeRenderer::renderSolids(), and vl::Applet::resizeEvent().
|
inlinevirtual |
The Framebuffer on which the rendering is performed.
Implements vl::RendererAbstract.
Definition at line 103 of file Renderer.hpp.
|
inline |
Definition at line 93 of file Renderer.hpp.
Referenced by vl::EdgeRenderer::render(), and renderRaw().
|
inline |
Definition at line 94 of file Renderer.hpp.
References vl::Actor::enableMask(), and vl::Actor::isEnabled().
|
inline |
Render states that will be used as default by the opengl context by this renderer.
Useful for example to setup the default left/right color mask for anaglyph stereo rendering.
Definition at line 87 of file Renderer.hpp.
Referenced by render().
|
inline |
Render states that will be used as default by the opengl context by this renderer.
Useful for example to setup the default left/right color mask for anaglyph stereo rendering.
Definition at line 91 of file Renderer.hpp.
|
inline |
Definition at line 69 of file Renderer.hpp.
Referenced by vl::OcclusionCullRenderer::render_pass2(), and renderRaw().
|
inline |
Definition at line 71 of file Renderer.hpp.
|
virtual |
Takes as input the render queue to render and returns a possibly filtered render queue for further processing.
Renderer's implementation of this function always returns in_render_queue
.
Implements vl::RendererAbstract.
Reimplemented in vl::EdgeRenderer, and vl::OcclusionCullRenderer.
Definition at line 365 of file Renderer.cpp.
References vl::Viewport::activate(), vl::FramebufferObject::activate(), vl::RendererAbstract::clearFlags(), vl::OpenGLContext::defaultRenderState(), vl::RendererAbstract::dispatchOnRendererFinished(), vl::RendererAbstract::dispatchOnRendererStarted(), vl::RendererAbstract::enableMask(), framebuffer(), vl::globalSettings(), vl::OpenGLContext::isCleanState(), vl::RendererAbstract::mRenderTick, vl::FramebufferObject::openglContext(), overriddenDefaultRenderStates(), renderRaw(), vl::Viewport::setClearFlags(), vl::OpenGLContext::setDefaultRenderState(), vl::Camera::viewport(), VL_CHECK, and VL_CHECK_OGL.
const RenderQueue * Renderer::renderRaw | ( | const RenderQueue * | in_render_queue, |
Camera * | camera, | ||
real | frame_clock | ||
) |
Used by render() to loop through the render queue.
Does not activate the framebuffer, does not activate the viewport, does not clear the viewport, does not setup the override states, does not issue the OnRendererStarted/Finished callbacks.
Definition at line 88 of file Renderer.cpp.
References vl::OpenGLContext::applyEnables(), vl::OpenGLContext::applyRenderStates(), vl::GLSLProgram::applyUniformSet(), vl::OpenGLContext::areUniformsColliding(), vl::RenderQueue::at(), vl::OpenGLContext::bindVAS(), vl::Log::bug(), vl::Actor::dispatchOnActorRenderStarted(), vl::Scissor::enable(), vl::Actor::enableMask(), vl::Log::error(), framebuffer(), vl::Shader::getEnableSet(), vl::Shader::getRenderStateSet(), vl::Actor::getUniformSet(), vl::GLSLProgram::getUniformSet(), vl::Shader::getUniformSet(), vl::RenderStateSet::glslProgram(), vl::Shader::glslProgram(), vl::GLSLProgram::handle(), vl::Has_Fixed_Function_Pipeline, vl::Viewport::height(), vl::GLSLProgram::infoLog(), isEnabled(), vl::GLSLProgram::linked(), vl::RenderToken::mActor, mDummyEnables, mDummyStateSet, vl::RenderToken::mNextPass, vl::RenderToken::mRenderable, vl::RenderToken::mShader, mShaderOverrideMask, NULL, vl::Object::objectName(), vl::FramebufferObject::openglContext(), projViewTransfCallback(), vl::Renderable::render(), vl::Actor::scissor(), vl::Shader::scissor(), vl::RenderQueue::size(), vl::Actor::transform(), vl::UniformSet::uniforms(), vl::ProjViewTransfCallback::updateMatrices(), vl::GLSLProgram::validateProgram(), vl::Camera::viewport(), VL_CHECK, VL_CHECK_OGL, VL_TRAP, vl::Viewport::width(), vl::Viewport::x(), and vl::Viewport::y().
Referenced by render().
|
inline |
The Framebuffer on which the rendering is performed.
Definition at line 97 of file Renderer.hpp.
|
inline |
Definition at line 67 of file Renderer.hpp.
A bitmask/Shader map used to everride the Shader of those Actors whose enable mask satisfy the following condition: (Actors::enableMask() & bitmask) != 0.
Useful when you want to override the Shader of a whole set of Actors. If multiple mask/shader pairs match an Actor's enable mask then the shader with the corresponding lowest mask will be used. See also vl::Actor::enableMask() and vl::Rendering::effectOverrideMask().
Definition at line 77 of file Renderer.hpp.
A bitmask/Shader map used to everride the Shader of those Actors whose enable mask satisfy the following condition: (Actors::enableMask() & bitmask) != 0.
Useful when you want to override the Shader of a whole set of Actors. If multiple mask/shader pairs match an Actor's enable mask then the shader with the corresponding lowest mask will be used. See also vl::Actor::enableMask() and vl::Rendering::effectOverrideMask().
Definition at line 83 of file Renderer.hpp.
Definition at line 109 of file Renderer.hpp.
Referenced by vl::OcclusionCullRenderer::render_pass2(), Renderer(), and renderRaw().
|
protected |
Definition at line 110 of file Renderer.hpp.
Referenced by vl::OcclusionCullRenderer::render_pass2(), Renderer(), and renderRaw().
|
protected |
Definition at line 106 of file Renderer.hpp.
|
protected |
Definition at line 114 of file Renderer.hpp.
|
protected |
Definition at line 116 of file Renderer.hpp.
Referenced by Renderer().
Definition at line 112 of file Renderer.hpp.
Referenced by renderRaw().
Visualization Library 2.1.0 Reference Documentation
Updated on Wed Mar 10 2021 16:02:53.
© Copyright Michele Bosi. All rights reserved.