Mondschein Engine  0.3.0
Public Member Functions | List of all members
mondschein::renderer::Renderer Class Referenceabstract

This class represents the renderer interface. More...

#include <renderer.h>

Inheritance diagram for mondschein::renderer::Renderer:
mondschein::renderer::GL13

Public Member Functions

virtual void set_context (Context_p _c)
 Set the rendering context. More...
 
virtual Context_p get_context () const
 Get the rendering context. More...
 
virtual void toggle_feature (const std::string &_feature, bool _state)=0
 Toggle renderer features. More...
 
virtual bool query_extension (const std::string &_ext)
 Queries OpenGL extension availablity. More...
 
virtual void set_clear_color (const Eigen::Vector4d &_c)=0
 Set the clear color. More...
 
virtual void clear_color_buffer ()=0
 Clear the color buffer.
 
virtual void clear_depth_buffer ()=0
 Clear the depth buffer.
 
virtual std::string id () const =0
 Get the renderer ID. More...
 
virtual void make_renderable (scene::Scenenode_c _sn)=0
 Make a scene node renderable. More...
 
virtual void render (scene::Scenegraph_c _sg, const uint32 _start)=0
 Render a scenegraph. More...
 

Detailed Description

This class represents the renderer interface.

The renderer is the part of the Mondschein Engine creating the actual 2D-image out of the given data. Thus it is the only part allowed to pass rendering commands to the graphics hardware.
The Renderer interface class represents the common base of any renderer implementation of the "Mondschein Engine".

Definition at line 42 of file renderer.h.

Member Function Documentation

Context_p Renderer::get_context ( ) const
virtual

Get the rendering context.

Returns
the rendering context

This member returns the rendering context.

Definition at line 42 of file renderer.cpp.

virtual std::string mondschein::renderer::Renderer::id ( ) const
pure virtual

Get the renderer ID.

Returns
a unique class identification string

This member function uniquely identifies the renderer class type. This ID string also defines the OpenGL version implemented in this renderer.

Implemented in mondschein::renderer::GL13.

void Renderer::make_renderable ( scene::Scenenode_c  _sn)
pure virtual

Make a scene node renderable.

Parameters
_snthe scene node object

This member function makes the scenenode renderable within the current context

Implemented in mondschein::renderer::GL13.

Definition at line 136 of file renderer.cpp.

bool Renderer::query_extension ( const std::string &  _ext)
virtual

Queries OpenGL extension availablity.

Parameters
_extthe extension name
Returns
TRUE if the extension is available, FALSE otherwise

Definition at line 65 of file renderer.cpp.

void Renderer::render ( scene::Scenegraph_c  _sg,
const uint32  _start 
)
pure virtual

Render a scenegraph.

Parameters
_sgthe scenegraph object

Implemented in mondschein::renderer::GL13.

Definition at line 153 of file renderer.cpp.

void Renderer::set_clear_color ( const Eigen::Vector4d &  _c)
pure virtual

Set the clear color.

Parameters
_colorthe clear color value

Implemented in mondschein::renderer::GL13.

Definition at line 85 of file renderer.cpp.

void Renderer::set_context ( Context_p  _c)
virtual

Set the rendering context.

Parameters
_cthe rendering context
Exceptions
Ifthe renderer and _c are incompatible

This member function sets _c as its rendering context and checks if it is compatible to the renderer. If not, an exception is thrown.

Definition at line 37 of file renderer.cpp.

void Renderer::toggle_feature ( const std::string &  _feature,
bool  _state 
)
pure virtual

Toggle renderer features.

Parameters
_featurethe feature string
_statethe feature state (ON or OFF)
Exceptions
mondschein::exceptionif the feature is not found or supported

Implemented in mondschein::renderer::GL13.

Definition at line 47 of file renderer.cpp.


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