YAPOG  0.0.1
Yet Another Pokemon Online Game
DrawingContext.hpp
Go to the documentation of this file.
1 #ifndef YAPOG_DRAWINGCONTEXT_HPP
2 # define YAPOG_DRAWINGCONTEXT_HPP
3 
4 # include <SFML/Graphics/RenderWindow.hpp>
5 
6 # include "YAPOG/Macros.hpp"
7 # include "YAPOG/Collection/Map.hpp"
11 
12 namespace yap
13 {
16  {
18 
19  public:
20 
21  DrawingContext (const Vector2& size, const String& name);
22  virtual ~DrawingContext ();
23 
26  virtual void AddCamera (const CameraMode& mode, ICamera* camera);
27  virtual void RemoveCamera (const CameraMode& mode);
28 
29  virtual const ICamera& GetCamera () const;
30  virtual ICamera& GetCamera ();
31  virtual const ICamera& GetCamera (const CameraMode& mode) const;
32  virtual ICamera& GetCamera (const CameraMode& mode);
33 
34  virtual void SetMode (const CameraMode& mode);
35  virtual void SetDefaultMode (const CameraMode& mode);
36  virtual void SetDefaultCamera ();
37 
38  virtual const sf::RenderTarget& GetRenderTarget () const;
39  virtual sf::RenderTarget& GetRenderTarget ();
40 
41  virtual void Draw (const sf::Drawable& drawable);
42  virtual void Draw (
43  const sf::Drawable& drawable,
44  const sf::RenderStates& states);
45 
46  virtual const sf::Color& GetTargetClearColor () const;
47  virtual void SetTargetClearColor (const sf::Color& color);
48 
49  virtual void ChangeSize (const Vector2& size);
51 
52  sf::RenderWindow& GetWindow ();
53 
54  protected:
55 
56  virtual void HandleDraw (
57  const sf::Drawable& drawable,
58  const sf::RenderStates& states);
59 
60  private:
61 
62  void SetCurrentMode (const CameraMode& mode);
63 
64  static const sf::Color DEFAULT_TARGET_CLEAR_COLOR;
65 
66  sf::RenderWindow window_;
70 
71  sf::Color targetClearColor_;
72  };
73 } // namespace yap
74 
75 #endif // YAPOG_DRAWINGCONTEXT_HPP