ShishGL  1.0
A simple modular cross-platform graphics library
TextureFill.hpp
Go to the documentation of this file.
1 /*============================================================================*/
2 #ifndef SHISHGL_TEXTURE_FILL_HPP
3 #define SHISHGL_TEXTURE_FILL_HPP
4 /*============================================================================*/
5 #include <string_view>
6 
7 #include "Style.hpp"
8 #include "ResourceManager.hpp"
9 #include "RenderSystem.hpp"
10 /*============================================================================*/
11 namespace Sh {
12 
13  class TextureFill : public Style {
14  public:
15 
16  explicit TextureFill(const std::string_view& filename)
17  : file(filename) {
19  }
20 
21  void apply(Frame& frame, const Shape2D& shape) override {
23  shape.draw(frame);
24  }
25 
26  ~TextureFill() override = default;
27 
28  private:
29 
30  const std::string_view file;
31 
32  };
33 
34 }
35 /*============================================================================*/
36 #endif //SHISHGL_TEXTURE_FILL_HPP
37 /*============================================================================*/
Sh::Shape2D
Definition: Shape2D.hpp:12
Sh::TextureFill::apply
void apply(Frame &frame, const Shape2D &shape) override
Definition: TextureFill.hpp:21
Sh::TextureFill::TextureFill
TextureFill(const std::string_view &filename)
Definition: TextureFill.hpp:16
Sh::Frame
Definition: Frame.hpp:9
Sh::TextureFill
Definition: TextureFill.hpp:13
Sh::ResourceManager::get
static const Resource & get(const std::string_view &filename)
Definition: ResourceManager.cpp:61
Sh::IPlatform::setTexture
virtual void setTexture(const ResourceManager::Resource &texture)=0
Style.hpp
Sh::PLATFORM
IPlatform & PLATFORM()
Definition: RenderSystem.cpp:32
ResourceManager.hpp
Sh::Style
Definition: Style.hpp:12
Sh::ResourceManager::load
static void load(const std::string_view &filename)
Definition: ResourceManager.cpp:21
Sh
Definition: CoreApplication.hpp:10
RenderSystem.hpp
Sh::Shape2D::draw
virtual void draw(const Frame &viewport) const =0
Sh::TextureFill::~TextureFill
~TextureFill() override=default