ShishGL  1.0
A simple modular cross-platform graphics library
ColorFill.hpp
Go to the documentation of this file.
1 /*============================================================================*/
2 #ifndef SHISHGL_COLOR_FILL_HPP
3 #define SHISHGL_COLOR_FILL_HPP
4 /*============================================================================*/
5 #include "Style.hpp"
6 #include "Color.hpp"
7 #include "RenderSystem.hpp"
8 /*============================================================================*/
9 namespace Sh {
10 
11  class ColorFill : public Style {
12  public:
13 
14  explicit ColorFill(const Color& color)
15  : fill_color(color)
16  { }
17 
18  void apply(Frame& frame, const Shape2D& shape) override {
19  PLATFORM().setColor(fill_color);
20  shape.draw(frame);
21  }
22 
23  ~ColorFill() override = default;
24 
25  private:
26 
27  Color fill_color;
28 
29  };
30 
31 }
32 /*============================================================================*/
33 #endif //SHISHGL_COLOR_FILL_HPP
34 /*============================================================================*/
Sh::ColorFill::apply
void apply(Frame &frame, const Shape2D &shape) override
Definition: ColorFill.hpp:18
Sh::ColorFill::~ColorFill
~ColorFill() override=default
Sh::Shape2D
Definition: Shape2D.hpp:12
Sh::Frame
Definition: Frame.hpp:9
Sh::ColorFill::ColorFill
ColorFill(const Color &color)
Definition: ColorFill.hpp:14
Style.hpp
Sh::PLATFORM
IPlatform & PLATFORM()
Definition: RenderSystem.cpp:32
Sh::IPlatform::setColor
virtual void setColor(const Color &color)=0
Sh::Style
Definition: Style.hpp:12
Sh
Definition: CoreApplication.hpp:10
RenderSystem.hpp
Sh::Color
Definition: Color.hpp:9
Sh::Shape2D::draw
virtual void draw(const Frame &viewport) const =0
Color.hpp
Sh::ColorFill
Definition: ColorFill.hpp:11