This basic video renderer manages the graphical rendering of all registered views. More...
#include <OSDLVideoRenderer.h>
Public Member Functions | |
VideoRenderer (bool registerToRootRenderer=true) | |
Constructs a new video renderer. | |
virtual | ~VideoRenderer () throw () |
Virtual destructor, no view is destroyed. | |
virtual void | render (Events::RenderingTick currentRenderingTick=0) |
Returns whether this video renderer has an internal camera available. | |
virtual void | onRenderingSkipped (Events::RenderingTick skippedRenderingTick) |
Allows the video renderer to be aware that a rendering step has to be skipped. | |
virtual const std::string | toString (Ceylan::VerbosityLevels level=Ceylan::high) const |
Returns an user-friendly description of the state of this object. | |
Static Public Member Functions | |
static bool | HasExistingRootRenderer () |
Tells whether a root renderer is available. | |
static Renderer & | GetExistingRootRenderer () |
Returns the one and only one root renderer instance that may be already available. | |
static void | DeleteExistingRootRenderer () |
Deletes the existing root renderer. | |
static void | DeleteRootRenderer () |
Deletes the root renderer, if any. | |
Protected Attributes | |
RenderCount | _renderingDone |
Counts the number of renderings achieved. | |
RenderCount | _renderingSkipped |
Counts the number of renderings skipped. | |
Events::RenderingTick | _lastRender |
Records the last rendering tick. | |
Private Member Functions | |
VideoRenderer (const VideoRenderer &source) | |
The internal camera which is used to render, if any. | |
VideoRenderer & | operator= (const VideoRenderer &source) |
Assignment operator made private to ensure that it will never be called. |
This basic video renderer manages the graphical rendering of all registered views.
Its rendering is mainly triggered by the root renderer, if it exists and if this video renderer has been registered to this root renderer.
Specialized video renderers can take in charge for example multiple viewports and cameras, BSP trees, etc.
Definition at line 85 of file OSDLVideoRenderer.h.
VideoRenderer::VideoRenderer | ( | bool | registerToRootRenderer = true |
) | [explicit] |
Constructs a new video renderer.
registerToRootRenderer | iff true, this video renderer will register itself automatically to the root renderer, which must implement the MultimediaRenderer interface so that this video renderer can be plugged. |
VideoRenderingException | if registerToRootRenderer is true and no root renderer is available, or if the root renderer is not able to register video renderers (which means it is not a Multimedia renderer). |
Definition at line 80 of file OSDLVideoRenderer.cc.
References OSDL::Rendering::Renderer::GetExistingRootRenderer(), and OSDL::Rendering::MultimediaRenderer::setVideoRenderer().
VideoRenderer::~VideoRenderer | ( | ) | throw () [virtual] |
Virtual destructor, no view is destroyed.
Definition at line 122 of file OSDLVideoRenderer.cc.
OSDL::Rendering::VideoRenderer::VideoRenderer | ( | const VideoRenderer & | source | ) | [private] |
The internal camera which is used to render, if any.
Copy constructor made private to ensure that it will never be called.
The compiler should complain whenever this undefined constructor is called, implicitly or not.
void Renderer::DeleteExistingRootRenderer | ( | ) | [static, inherited] |
Deletes the existing root renderer.
RenderingException | if not renderer was available. |
Definition at line 185 of file OSDLRenderer.cc.
void Renderer::DeleteRootRenderer | ( | ) | [static, inherited] |
Deletes the root renderer, if any.
Definition at line 201 of file OSDLRenderer.cc.
Renderer & Renderer::GetExistingRootRenderer | ( | ) | [static, inherited] |
Returns the one and only one root renderer instance that may be already available.
RenderingException | if there is no root renderer already available. |
Definition at line 173 of file OSDLRenderer.cc.
Referenced by OSDL::Rendering::AudioRenderer::AudioRenderer(), OSDL::Events::EventsModule::enterBasicMainLoop(), and VideoRenderer().
bool Renderer::HasExistingRootRenderer | ( | ) | [static, inherited] |
Tells whether a root renderer is available.
Definition at line 164 of file OSDLRenderer.cc.
References OSDL::Rendering::Renderer::_internalRootRenderer.
Referenced by OSDL::Events::EventsModule::enterBasicMainLoop().
virtual void OSDL::Rendering::VideoRenderer::onRenderingSkipped | ( | Events::RenderingTick | skippedRenderingTick | ) | [virtual] |
Allows the video renderer to be aware that a rendering step has to be skipped.
It may be a chance for it to trigger counter-measures, such as decreasing the level of detail in order not to slow down the whole process.
skippedRenderingTick | the rendering tick that had to be skipped. |
Reimplemented from OSDL::Rendering::Renderer.
VideoRenderer& OSDL::Rendering::VideoRenderer::operator= | ( | const VideoRenderer & | source | ) | [private] |
Assignment operator made private to ensure that it will never be called.
The compiler should complain whenever this undefined operator is called, implicitly or not.
virtual void OSDL::Rendering::VideoRenderer::render | ( | Events::RenderingTick | currentRenderingTick = 0 |
) | [virtual] |
Returns whether this video renderer has an internal camera available.
virtual bool hasCamera() const ; Returns the internal camera of this video renderer.
VideoRenderingException | iff no camera is available. virtual Camera & getCamera() const ; Sets the internal camera of this video renderer. |
newCamera | the new camera to use from now on. |
virtual void setCamera( Camera & newCamera ) ; Triggers the actual video rendering of all views, for specified rendering tick, if any.
currentRenderingTick | the rendering tick corresponding to this render step. |
If the renderer is called from a basic event loop (no scheduler is used), then the rendering tick is meaningless and is always zero.
Reimplemented from OSDL::Rendering::Renderer.
const string VideoRenderer::toString | ( | Ceylan::VerbosityLevels | level = Ceylan::high |
) | const [virtual] |
Returns an user-friendly description of the state of this object.
level | the requested verbosity level. |
Reimplemented from OSDL::Rendering::Renderer.
Definition at line 188 of file OSDLVideoRenderer.cc.
References OSDL::Rendering::Renderer::_lastRender, OSDL::Rendering::Renderer::_renderingDone, and OSDL::Rendering::Renderer::_renderingSkipped.
Referenced by OSDL::Video::VideoModule::toString(), and OSDL::Rendering::MultimediaRenderer::toString().
Events::RenderingTick OSDL::Rendering::Renderer::_lastRender [protected, inherited] |
Records the last rendering tick.
Useful to check whether no rendering tick was missed.
Definition at line 287 of file OSDLRenderer.h.
Referenced by toString(), OSDL::Rendering::StandardRenderer::toString(), OSDL::Rendering::Renderer::toString(), OSDL::Rendering::MultimediaRenderer::toString(), and OSDL::Rendering::AudioRenderer::toString().
RenderCount OSDL::Rendering::Renderer::_renderingDone [protected, inherited] |
Counts the number of renderings achieved.
Definition at line 269 of file OSDLRenderer.h.
Referenced by toString(), OSDL::Rendering::StandardRenderer::toString(), OSDL::Rendering::Renderer::toString(), OSDL::Rendering::MultimediaRenderer::toString(), and OSDL::Rendering::AudioRenderer::toString().
RenderCount OSDL::Rendering::Renderer::_renderingSkipped [protected, inherited] |
Counts the number of renderings skipped.
Definition at line 277 of file OSDLRenderer.h.
Referenced by toString(), OSDL::Rendering::StandardRenderer::toString(), OSDL::Rendering::Renderer::toString(), OSDL::Rendering::MultimediaRenderer::toString(), and OSDL::Rendering::AudioRenderer::toString().