lxgui
Loading...
Searching...
No Matches
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
10namespace lxgui::gui::sfml {
11
12class renderer;
13
19class atlas_page final : public gui::atlas_page {
20public:
23
24protected:
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
46private:
47 sf::Texture texture_;
48};
49
56class atlas final : public gui::atlas {
57public:
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
70protected:
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.
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...
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(gui::renderer &rdr, material::filter filt)
Constructor.
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 & operator=(atlas &&tex)=delete
atlas & operator=(const atlas &tex)=delete
atlas(renderer &rdr, material::filter filt)
Constructor for textures.
atlas(const atlas &tex)=delete
atlas(atlas &&tex)=delete
std::unique_ptr< gui::atlas_page > create_page_() override
Create a new page in this atlas.
SFML implementation of rendering.