YAPOG  0.0.1
Yet Another Pokemon Online Game
yap::DrawingContext Class Reference

A common implementation of an IDrawingContext. More...

#include <DrawingContext.hpp>

Inheritance diagram for yap::DrawingContext:
Collaboration diagram for yap::DrawingContext:

List of all members.

Public Member Functions

 DrawingContext (const Vector2 &size, const String &name)
virtual ~DrawingContext ()
sf::RenderWindow & GetWindow ()
IDrawingContext members.
virtual void AddCamera (const CameraMode &mode, ICamera *camera)
 Adds an ICamera associated to a CameraMode.
virtual void RemoveCamera (const CameraMode &mode)
 Remove an ICamera associated to a CameraMode.
virtual const ICameraGetCamera () const
 Gets the Camera associated to the CameraMode currently used.
virtual ICameraGetCamera ()
 Gets the Camera associated to the CameraMode currently used.
virtual const ICameraGetCamera (const CameraMode &mode) const
 Gets the Camera associated to a CameraMode.
virtual ICameraGetCamera (const CameraMode &mode)
 Gets the Camera associated to a CameraMode.
virtual void SetMode (const CameraMode &mode)
 Sets the CameraMode currently used by the IDrawingContext.
virtual void SetDefaultMode (const CameraMode &mode)
 Sets the CameraMode used by default i-e the CameraMode when IDrawingContext::SetDefaultCamera () is called.
virtual void SetDefaultCamera ()
 Sets the default CameraMode as the current one used.
virtual const sf::RenderTarget & GetRenderTarget () const
 Gets the RenderTarget of this IDrawingContext.
virtual sf::RenderTarget & GetRenderTarget ()
 Gets the RenderTarget of this IDrawingContext.
virtual void Draw (const sf::Drawable &drawable)
 Renders the Drawable into the RenderTarget of this DrawingContext with the current settings.
virtual void Draw (const sf::Drawable &drawable, const sf::RenderStates &states)
virtual const sf::Color & GetTargetClearColor () const
virtual void SetTargetClearColor (const sf::Color &color)
virtual void ChangeSize (const Vector2 &size)
- Public Member Functions inherited from yap::IDrawingContext
virtual ~IDrawingContext ()

Protected Member Functions

virtual void HandleDraw (const sf::Drawable &drawable, const sf::RenderStates &states)

Private Member Functions

 DISALLOW_COPY (DrawingContext)
void SetCurrentMode (const CameraMode &mode)

Private Attributes

sf::RenderWindow window_
CameraMode currentMode_
CameraMode defaultMode_
collection::Map< CameraMode,
ICamera * > 
cameras_
sf::Color targetClearColor_

Static Private Attributes

static const sf::Color DEFAULT_TARGET_CLEAR_COLOR

Detailed Description

A common implementation of an IDrawingContext.

Definition at line 15 of file DrawingContext.hpp.


Constructor & Destructor Documentation

yap::DrawingContext::DrawingContext ( const Vector2 size,
const String name 
)

Definition at line 8 of file DrawingContext.cpp.

yap::DrawingContext::~DrawingContext ( )
virtual

Definition at line 17 of file DrawingContext.cpp.


Member Function Documentation

void yap::DrawingContext::AddCamera ( const CameraMode mode,
ICamera camera 
)
virtual

Adds an ICamera associated to a CameraMode.

Parameters:
modeCameraMode associated to the ICamera.
cameraICamera associated to the CameraMode.

Implements yap::IDrawingContext.

Definition at line 23 of file DrawingContext.cpp.

Here is the call graph for this function:

void yap::DrawingContext::ChangeSize ( const Vector2 size)
virtual

Implements yap::IDrawingContext.

Definition at line 127 of file DrawingContext.cpp.

yap::DrawingContext::DISALLOW_COPY ( DrawingContext  )
private
void yap::DrawingContext::Draw ( const sf::Drawable &  drawable)
virtual

Renders the Drawable into the RenderTarget of this DrawingContext with the current settings.

Parameters:
drawableDrawable to render into this IDrawingContext.

Implements yap::IDrawingContext.

Definition at line 86 of file DrawingContext.cpp.

void yap::DrawingContext::Draw ( const sf::Drawable &  drawable,
const sf::RenderStates &  states 
)
virtual

Definition at line 91 of file DrawingContext.cpp.

Here is the call graph for this function:

const ICamera & yap::DrawingContext::GetCamera ( ) const
virtual

Gets the Camera associated to the CameraMode currently used.

Returns:
A constant reference to the current Camera.

Implements yap::IDrawingContext.

Definition at line 41 of file DrawingContext.cpp.

Here is the caller graph for this function:

ICamera & yap::DrawingContext::GetCamera ( )
virtual

Gets the Camera associated to the CameraMode currently used.

Returns:
A non-constant reference to the current Camera.

Implements yap::IDrawingContext.

Definition at line 46 of file DrawingContext.cpp.

Here is the call graph for this function:

const ICamera & yap::DrawingContext::GetCamera ( const CameraMode mode) const
virtual

Gets the Camera associated to a CameraMode.

Parameters:
modeCameraMode to get the Camera associated with.
Returns:
A constant reference to the Camera.

Implements yap::IDrawingContext.

Definition at line 51 of file DrawingContext.cpp.

ICamera & yap::DrawingContext::GetCamera ( const CameraMode mode)
virtual

Gets the Camera associated to a CameraMode.

Parameters:
modeCameraMode to get the Camera associated with.
Returns:
A non-constant reference to the Camera.

Implements yap::IDrawingContext.

Definition at line 56 of file DrawingContext.cpp.

const sf::RenderTarget & yap::DrawingContext::GetRenderTarget ( ) const
virtual

Gets the RenderTarget of this IDrawingContext.

Returns:
A constant reference to the RenderTarget.

Implements yap::IDrawingContext.

Definition at line 76 of file DrawingContext.cpp.

Here is the caller graph for this function:

sf::RenderTarget & yap::DrawingContext::GetRenderTarget ( )
virtual

Gets the RenderTarget of this IDrawingContext.

Returns:
A non-constant reference to the RenderTarget.

Implements yap::IDrawingContext.

Definition at line 81 of file DrawingContext.cpp.

const sf::Color & yap::DrawingContext::GetTargetClearColor ( ) const
virtual

Implements yap::IDrawingContext.

Definition at line 98 of file DrawingContext.cpp.

sf::RenderWindow & yap::DrawingContext::GetWindow ( )

Definition at line 122 of file DrawingContext.cpp.

Here is the caller graph for this function:

void yap::DrawingContext::HandleDraw ( const sf::Drawable &  drawable,
const sf::RenderStates &  states 
)
protectedvirtual

Definition at line 108 of file DrawingContext.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::DrawingContext::RemoveCamera ( const CameraMode mode)
virtual

Remove an ICamera associated to a CameraMode.

Parameters:
modeCameraMode associated to the ICamera to remove.

Implements yap::IDrawingContext.

Definition at line 36 of file DrawingContext.cpp.

Here is the call graph for this function:

void yap::DrawingContext::SetCurrentMode ( const CameraMode mode)
private

Definition at line 115 of file DrawingContext.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void yap::DrawingContext::SetDefaultCamera ( )
virtual

Sets the default CameraMode as the current one used.

Implements yap::IDrawingContext.

Definition at line 71 of file DrawingContext.cpp.

Here is the call graph for this function:

void yap::DrawingContext::SetDefaultMode ( const CameraMode mode)
virtual

Sets the CameraMode used by default i-e the CameraMode when IDrawingContext::SetDefaultCamera () is called.

Parameters:
modeCameraMode to set by default.

Implements yap::IDrawingContext.

Definition at line 66 of file DrawingContext.cpp.

void yap::DrawingContext::SetMode ( const CameraMode mode)
virtual

Sets the CameraMode currently used by the IDrawingContext.

Parameters:
modeCameraMode to use.

Implements yap::IDrawingContext.

Definition at line 61 of file DrawingContext.cpp.

Here is the call graph for this function:

void yap::DrawingContext::SetTargetClearColor ( const sf::Color &  color)
virtual

Implements yap::IDrawingContext.

Definition at line 103 of file DrawingContext.cpp.


Member Data Documentation

collection::Map<CameraMode, ICamera*> yap::DrawingContext::cameras_
private

Definition at line 69 of file DrawingContext.hpp.

CameraMode yap::DrawingContext::currentMode_
private

Definition at line 67 of file DrawingContext.hpp.

const sf::Color yap::DrawingContext::DEFAULT_TARGET_CLEAR_COLOR
staticprivate
Initial value:
sf::Color::Black

Definition at line 64 of file DrawingContext.hpp.

CameraMode yap::DrawingContext::defaultMode_
private

Definition at line 68 of file DrawingContext.hpp.

sf::Color yap::DrawingContext::targetClearColor_
private

Definition at line 71 of file DrawingContext.hpp.

sf::RenderWindow yap::DrawingContext::window_
private

Definition at line 66 of file DrawingContext.hpp.


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