OSDL::Rendering::StandardRenderer Class Reference

The standard renderer manages a list of views and offers a specific support for OpenGL. More...

#include <OSDLStandardRenderer.h>

Inheritance diagram for OSDL::Rendering::StandardRenderer:
Inheritance graph
[legend]
Collaboration diagram for OSDL::Rendering::StandardRenderer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 StandardRenderer (Video::Surface &screen, bool registerToScheduler=true)
 Constructs a new standard renderer.
virtual ~StandardRenderer () throw ()
 Virtual destructor, no view is destroyed.
virtual void registerView (Ceylan::MVC::BaseView &view)
 Registers specified view to this renderer.
virtual void unregisterView (Ceylan::MVC::BaseView &view)
 Unregisters specified view to this renderer.
virtual void render (Events::RenderingTick currentRenderingTick=0)
 Triggers the actual rendering of all views, for specified rendering tick, if any.
virtual void onRenderingSkipped (Events::RenderingTick skippedRenderingTick)
 Allows the renderer to be aware that a rendering step had 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 RendererGetExistingRootRenderer ()
 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

Video::Surface_screen
 The screen surface that will have to be updated.
std::list
< Ceylan::MVC::BaseView * > 
_registeredViews
 Records all the currently registered views that shall be managed specifically by this renderer.
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

 StandardRenderer (const StandardRenderer &source)
 Copy constructor made private to ensure that it will never be called.
StandardRendereroperator= (const StandardRenderer &source)
 Assignment operator made private to ensure that it will never be called.

Static Private Attributes

static Renderer_internalRootRenderer
 The internal single instance of renderer, at the top of the renderer hierarchy, if any.

Detailed Description

The standard renderer manages a list of views and offers a specific support for OpenGL.

Any view is supposed to be registered only once, or not at all.

See also:
Renderer

Definition at line 86 of file OSDLStandardRenderer.h.


Constructor & Destructor Documentation

StandardRenderer::StandardRenderer ( Video::Surface screen,
bool  registerToScheduler = true 
) [explicit]

Constructs a new standard renderer.

Parameters:
screen the screen that shall be updated by this renderer.
registerToScheduler iff true, then a scheduler is supposed to exist already, and this renderer is automatically registered to this scheduler so that it gets called at each rendering tick.
Exceptions:
RenderingException if registerToScheduler is true and no scheduler is available.

Definition at line 70 of file OSDLStandardRenderer.cc.

StandardRenderer::~StandardRenderer (  )  throw () [virtual]

Virtual destructor, no view is destroyed.

Definition at line 89 of file OSDLStandardRenderer.cc.

References _registeredViews, and OSDL::Video::Pixels::toString().

OSDL::Rendering::StandardRenderer::StandardRenderer ( const StandardRenderer source  )  [explicit, private]

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.


Member Function Documentation

void Renderer::DeleteExistingRootRenderer (  )  [static, inherited]

Deletes the existing root renderer.

Exceptions:
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.

Note:
The returned value is a reference and not a pointer, to help avoiding any abnormal deallocation by its users, that should never deallocate the root renderer.
Exceptions:
RenderingException if there is no root renderer already available.
Note:
There is no 'GetRootRenderer' method that would create a root renderer if none was already set, since various renderers could be chosen as the root one.

Definition at line 173 of file OSDLRenderer.cc.

Referenced by OSDL::Rendering::AudioRenderer::AudioRenderer(), OSDL::Events::EventsModule::enterBasicMainLoop(), and OSDL::Rendering::VideoRenderer::VideoRenderer().

bool Renderer::HasExistingRootRenderer (  )  [static, inherited]

Tells whether a root renderer is available.

Returns:
true iff a root renderer is already available.

Definition at line 164 of file OSDLRenderer.cc.

References OSDL::Rendering::Renderer::_internalRootRenderer.

Referenced by OSDL::Events::EventsModule::enterBasicMainLoop().

void StandardRenderer::onRenderingSkipped ( Events::RenderingTick  skippedRenderingTick  )  [virtual]

Allows the renderer to be aware that a rendering step had to be skipped.

All registered views will be notified of the skip.

Parameters:
skippedRenderingTick the rendering tick that had to be skipped.

Reimplemented from OSDL::Rendering::Renderer.

Definition at line 170 of file OSDLStandardRenderer.cc.

References OSDL_RENDER_LOG, and OSDL::Video::Pixels::toString().

StandardRenderer& OSDL::Rendering::StandardRenderer::operator= ( const StandardRenderer 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.

void StandardRenderer::registerView ( Ceylan::MVC::BaseView &  view  )  [virtual]

Registers specified view to this renderer.

Ownership not taken.

Parameters:
view the view to register.

Definition at line 109 of file OSDLStandardRenderer.cc.

References _registeredViews.

virtual void OSDL::Rendering::StandardRenderer::render ( Events::RenderingTick  currentRenderingTick = 0  )  [virtual]

Triggers the actual rendering of all views, for specified rendering tick, if any.

Parameters:
currentRenderingTick the rendering tick corresponding to this render step.
Note:
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 StandardRenderer::toString ( Ceylan::VerbosityLevels  level = Ceylan::high  )  const [virtual]

Returns an user-friendly description of the state of this object.

Parameters:
level the requested verbosity level.
Note:
Text output format is determined from overall settings.
See also:
Ceylan::TextDisplayable

Reimplemented from OSDL::Rendering::Renderer.

Definition at line 189 of file OSDLStandardRenderer.cc.

References OSDL::Rendering::Renderer::_lastRender, OSDL::Rendering::Renderer::_renderingDone, and OSDL::Rendering::Renderer::_renderingSkipped.

void StandardRenderer::unregisterView ( Ceylan::MVC::BaseView &  view  )  [virtual]

Unregisters specified view to this renderer.

Parameters:
view the view to unregister.
Exceptions:
RenderingException if this view was not already registered.

Definition at line 118 of file OSDLStandardRenderer.cc.

References _registeredViews.


Member Data Documentation

The internal single instance of renderer, at the top of the renderer hierarchy, if any.

Reimplemented from OSDL::Rendering::Renderer.

Definition at line 252 of file OSDLStandardRenderer.h.

Records the last rendering tick.

Useful to check whether no rendering tick was missed.

Definition at line 287 of file OSDLRenderer.h.

Referenced by OSDL::Rendering::VideoRenderer::toString(), toString(), OSDL::Rendering::Renderer::toString(), OSDL::Rendering::MultimediaRenderer::toString(), and OSDL::Rendering::AudioRenderer::toString().

std::list<Ceylan::MVC::BaseView *> OSDL::Rendering::StandardRenderer::_registeredViews [protected]

Records all the currently registered views that shall be managed specifically by this renderer.

Note:
Views are not owned by the renderer.

Definition at line 212 of file OSDLStandardRenderer.h.

Referenced by registerView(), unregisterView(), and ~StandardRenderer().

The screen surface that will have to be updated.

Definition at line 201 of file OSDLStandardRenderer.h.


The documentation for this class was generated from the following files:
Generated on Mon Nov 29 14:05:57 2010 for OSDL by  doxygen 1.6.3