lxgui
Loading...
Searching...
No Matches
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 <cstdint>
9#include <memory>
10#include <vector>
11
12namespace lxgui::gui::gl {
13
14class renderer;
15
21class atlas_page final : public gui::atlas_page {
22public:
29
31 ~atlas_page() override;
32
33protected:
40 std::shared_ptr<gui::material>
41 add_material_(const gui::material& mat, const bounds2f& location) override;
42
47 float get_width_() const override;
48
53 float get_height_() const override;
54
55private:
56 std::uint32_t texture_handle_ = 0u;
57 std::size_t size_ = 0u;
58};
59
66class atlas final : public gui::atlas {
67public:
73 explicit atlas(renderer& rdr, material::filter filt);
74
75 atlas(const atlas& tex) = delete;
76 atlas(atlas&& tex) = delete;
77 atlas& operator=(const atlas& tex) = delete;
78 atlas& operator=(atlas&& tex) = delete;
79
80protected:
85 std::unique_ptr<gui::atlas_page> create_page_() override;
86};
87
88} // namespace lxgui::gui::gl
89
90#endif
A single texture holding multiple materials for efficient rendering.
Definition gui_atlas.hpp:25
A class that holds multiple materials for efficient rendering.
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.
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.
~atlas_page() override
Destructor.
float get_height_() const override
Return the height of this page (in pixels).
A class that holds rendering data This implementation can contain either a plain color or a real Open...
std::unique_ptr< gui::atlas_page > create_page_() override
Create a new page in this atlas.
atlas & operator=(atlas &&tex)=delete
atlas & operator=(const atlas &tex)=delete
atlas(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.