FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::RendererBase Class Referenceabstract

Base class for all view renderers View renderer renders one aspect of the view shown on screen. More...

#include <rendererbase.h>

+ Inheritance diagram for FIFE::RendererBase:
+ Collaboration diagram for FIFE::RendererBase:

Public Member Functions

 RendererBase (RenderBackend *renderbackend, int32_t position)
 Constructor. More...
 
 RendererBase (const RendererBase &old)
 Copy Constructor. More...
 
virtual RendererBaseclone ()=0
 Makes copy of this renderer. More...
 
virtual ~RendererBase ()
 Destructor. More...
 
virtual void render (Camera *cam, Layer *layer, RenderList &instances)=0
 This method is called by the view to ask renderer to draw its rendering aspect based on given parameters. More...
 
virtual std::string getName ()=0
 Name of the renderer. More...
 
int32_t getPipelinePosition () const
 Gets renderer position in the rendering pipeline. More...
 
void setPipelinePosition (int32_t position)
 Sets renderer position in the rendering pipeline Pipeline position defines in which order view calls the renderers when update occurs Note that renderers are called once per rendered layer, thus to update the whole screen, renderer might receive multiple calls. More...
 
virtual void setEnabled (bool enabled)
 Enables renderer. More...
 
virtual void reset ()
 Resets information in the renderer. More...
 
bool isEnabled () const
 Is renderer enabled. More...
 
void setRendererListener (IRendererListener *listener)
 Sets listener for renderer. More...
 
void addActiveLayer (Layer *layer)
 Adds active layer to renderer. More...
 
void removeActiveLayer (Layer *layer)
 Removes active layer from renderer. More...
 
void clearActiveLayers ()
 Clears all active layers from renderer. More...
 
void activateAllLayers (Map *elevation)
 Activates all layers from given elevation. More...
 
bool isActivedLayer (Layer *layer)
 Returns if given layer is currently activated. More...
 
std::list< Layer * > getActiveLayers () const
 Returns list of activated layer. More...
 

Protected Member Functions

 RendererBase ()
 

Protected Attributes

std::list< Layer * > m_active_layers
 
RenderBackendm_renderbackend
 

Private Attributes

bool m_enabled
 
int32_t m_pipeline_position
 
IRendererListenerm_listener
 

Detailed Description

Base class for all view renderers View renderer renders one aspect of the view shown on screen.

Definition at line 78 of file rendererbase.h.

Constructor & Destructor Documentation

FIFE::RendererBase::RendererBase ( RenderBackend renderbackend,
int32_t  position 
)

Constructor.

Parameters
renderbackendto use
positionposition for this renderer in rendering pipeline

Definition at line 41 of file rendererbase.cpp.

References setPipelinePosition().

FIFE::RendererBase::RendererBase ( const RendererBase old)

Copy Constructor.

Definition at line 49 of file rendererbase.cpp.

References m_pipeline_position, and setPipelinePosition().

virtual FIFE::RendererBase::~RendererBase ( )
inlinevirtual

Destructor.

Definition at line 96 of file rendererbase.h.

FIFE::RendererBase::RendererBase ( )
protected

Definition at line 57 of file rendererbase.cpp.

Member Function Documentation

void FIFE::RendererBase::activateAllLayers ( Map elevation)

Activates all layers from given elevation.

Definition at line 100 of file rendererbase.cpp.

References addActiveLayer(), clearActiveLayers(), and FIFE::Map::getLayers().

Referenced by FIFE::MapLoader::load().

+ Here is the caller graph for this function:

void FIFE::RendererBase::addActiveLayer ( Layer layer)

Adds active layer to renderer.

Only active layers are rendered

Definition at line 82 of file rendererbase.cpp.

References m_active_layers.

Referenced by activateAllLayers().

+ Here is the caller graph for this function:

void FIFE::RendererBase::clearActiveLayers ( )

Clears all active layers from renderer.

Definition at line 92 of file rendererbase.cpp.

References m_active_layers.

Referenced by activateAllLayers().

+ Here is the caller graph for this function:

std::list<Layer*> FIFE::RendererBase::getActiveLayers ( ) const
inline

Returns list of activated layer.

Definition at line 164 of file rendererbase.h.

int32_t FIFE::RendererBase::getPipelinePosition ( ) const
inline

Gets renderer position in the rendering pipeline.

Definition at line 117 of file rendererbase.h.

Referenced by FIFE::pipelineSort().

+ Here is the caller graph for this function:

bool FIFE::RendererBase::isActivedLayer ( Layer layer)

Returns if given layer is currently activated.

Definition at line 96 of file rendererbase.cpp.

References m_active_layers.

bool FIFE::RendererBase::isEnabled ( ) const
inline

Is renderer enabled.

Definition at line 136 of file rendererbase.h.

Referenced by FIFE::Camera::addRenderer(), and FIFE::Camera::onRendererEnabledChanged().

+ Here is the caller graph for this function:

void FIFE::RendererBase::removeActiveLayer ( Layer layer)

Removes active layer from renderer.

Definition at line 88 of file rendererbase.cpp.

References m_active_layers.

virtual void FIFE::RendererBase::render ( Camera cam,
Layer layer,
RenderList instances 
)
pure virtual

This method is called by the view to ask renderer to draw its rendering aspect based on given parameters.

Renderers receive non-clipped instance stack since there is no way to know which information is relevant for the renderer. E.g. effect renderer might need to know offscreen instance locations to be able to draw radiation coming from some instance not visible on the screen.

Parameters
camcamera view to draw
layercurrent layer to be rendered
instancesinstances on the current layer @ see setPipelinePosition

Implemented in FIFE::GenericRenderer, FIFE::LightRenderer, FIFE::CellRenderer, FIFE::BlockingInfoRenderer, FIFE::CellSelectionRenderer, FIFE::CoordinateRenderer, FIFE::FloatingTextRenderer, FIFE::QuadTreeRenderer, FIFE::InstanceRenderer, and FIFE::GridRenderer.

virtual void FIFE::RendererBase::reset ( )
inlinevirtual

Resets information in the renderer.

Reimplemented in FIFE::GenericRenderer, FIFE::LightRenderer, FIFE::InstanceRenderer, and FIFE::CellSelectionRenderer.

Definition at line 132 of file rendererbase.h.

void FIFE::RendererBase::setPipelinePosition ( int32_t  position)

Sets renderer position in the rendering pipeline Pipeline position defines in which order view calls the renderers when update occurs Note that renderers are called once per rendered layer, thus to update the whole screen, renderer might receive multiple calls.

Definition at line 64 of file rendererbase.cpp.

References m_listener, m_pipeline_position, and FIFE::IRendererListener::onRendererPipelinePositionChanged().

Referenced by RendererBase().

+ Here is the caller graph for this function:

void FIFE::RendererBase::setRendererListener ( IRendererListener listener)
inline

Sets listener for renderer.

Definition at line 140 of file rendererbase.h.

Referenced by FIFE::Camera::addRenderer().

+ Here is the caller graph for this function:

Member Data Documentation

std::list<Layer*> FIFE::RendererBase::m_active_layers
protected
bool FIFE::RendererBase::m_enabled
private

Definition at line 174 of file rendererbase.h.

Referenced by setEnabled().

IRendererListener* FIFE::RendererBase::m_listener
private

Definition at line 176 of file rendererbase.h.

Referenced by setEnabled(), and setPipelinePosition().

int32_t FIFE::RendererBase::m_pipeline_position
private

Definition at line 175 of file rendererbase.h.

Referenced by RendererBase(), and setPipelinePosition().


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