lxgui
gui_sfml_atlas.hpp
1 #ifndef LXGUI_GUI_SFML_ATLAS_HPP
2 #define LXGUI_GUI_SFML_ATLAS_HPP
3 
4 #include "lxgui/gui_atlas.hpp"
5 #include "lxgui/gui_material.hpp"
6 #include "lxgui/utils.hpp"
7 
8 #include <SFML/Graphics/Texture.hpp>
9 
10 namespace lxgui::gui::sfml {
11 
12 class renderer;
13 
19 class atlas_page final : public gui::atlas_page {
20 public:
23 
24 protected:
31  std::shared_ptr<gui::material>
32  add_material_(const gui::material& mat, const bounds2f& location) override;
33 
38  float get_width_() const override;
39 
44  float get_height_() const override;
45 
46 private:
47  sf::Texture texture_;
48 };
49 
56 class atlas final : public gui::atlas {
57 public:
63  explicit atlas(renderer& rdr, material::filter filt);
64 
65  atlas(const atlas& tex) = delete;
66  atlas(atlas&& tex) = delete;
67  atlas& operator=(const atlas& tex) = delete;
68  atlas& operator=(atlas&& tex) = delete;
69 
70 protected:
75  std::unique_ptr<gui::atlas_page> create_page_() override;
76 };
77 
78 } // namespace lxgui::gui::sfml
79 
80 #endif
A single texture holding multiple materials for efficient rendering.
Definition: gui_atlas.hpp:25
A class that holds multiple materials for efficient rendering.
Definition: gui_atlas.hpp:126
A class that holds rendering data.
Abstract type for implementation specific management.
A single texture holding multiple materials for efficient rendering This is an abstract class that mu...
atlas_page(gui::renderer &rdr, material::filter filt)
Constructor.
std::shared_ptr< gui::material > add_material_(const gui::material &mat, const bounds2f &location) override
Adds a new material to this page, at the provided location.
float get_height_() const override
Return the height of this page (in pixels).
float get_width_() const override
Return the width of this page (in pixels).
A class that holds rendering data This implementation can contain either a plain color or a real sf::...
atlas(renderer &rdr, material::filter filt)
Constructor for textures.
atlas & operator=(atlas &&tex)=delete
std::unique_ptr< gui::atlas_page > create_page_() override
Create a new page in this atlas.
atlas(const atlas &tex)=delete
atlas & operator=(const atlas &tex)=delete
atlas(atlas &&tex)=delete
SFML implementation of rendering.