lxgui
gui_gl_atlas.hpp
1 #ifndef LXGUI_GUI_GL_ATLAS_HPP
2 #define LXGUI_GUI_GL_ATLAS_HPP
3 
4 #include "lxgui/gui_atlas.hpp"
5 #include "lxgui/gui_material.hpp"
6 #include "lxgui/utils.hpp"
7 
8 #include <memory>
9 #include <vector>
10 
11 namespace lxgui::gui::gl {
12 
13 class renderer;
14 
20 class atlas_page final : public gui::atlas_page {
21 public:
28 
30  ~atlas_page() override;
31 
32 protected:
39  std::shared_ptr<gui::material>
40  add_material_(const gui::material& mat, const bounds2f& location) override;
41 
46  float get_width_() const override;
47 
52  float get_height_() const override;
53 
54 private:
55  std::uint32_t texture_handle_ = 0u;
56  std::size_t size_ = 0u;
57 };
58 
65 class atlas final : public gui::atlas {
66 public:
72  explicit atlas(renderer& rdr, material::filter filt);
73 
74  atlas(const atlas& tex) = delete;
75  atlas(atlas&& tex) = delete;
76  atlas& operator=(const atlas& tex) = delete;
77  atlas& operator=(atlas&& tex) = delete;
78 
79 protected:
84  std::unique_ptr<gui::atlas_page> create_page_() override;
85 };
86 
87 } // namespace lxgui::gui::gl
88 
89 #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 single texture holding multiple materials for efficient rendering This is an abstract class that mu...
float get_width_() const override
Return the width of this page (in pixels).
atlas_page(gui::renderer &rdr, material::filter filt)
Constructor.
~atlas_page() override
Destructor.
float get_height_() const override
Return the height of this page (in pixels).
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.
A class that holds rendering data This implementation can contain either a plain color or a real Open...
atlas(const atlas &tex)=delete
atlas & operator=(atlas &&tex)=delete
std::unique_ptr< gui::atlas_page > create_page_() override
Create a new page in this atlas.
atlas & operator=(const atlas &tex)=delete
atlas(renderer &rdr, material::filter filt)
Constructor for textures.
atlas(atlas &&tex)=delete
Open implementation of rendering.
A class that holds rendering data.
Abstract type for implementation specific management.