lxgui
|
A class that holds multiple materials for efficient rendering. More...
#include <gui_atlas.hpp>
Public Member Functions | |
atlas (renderer &rdr, material::filter filt) | |
Constructor. | |
virtual | ~atlas ()=default |
Destructor. | |
atlas (const atlas &)=delete | |
Non-copiable. | |
atlas (atlas &&)=delete | |
Non-movable. | |
atlas & | operator= (const atlas &)=delete |
Non-copiable. | |
atlas & | operator= (atlas &&)=delete |
Non-movable. | |
std::shared_ptr< material > | fetch_material (const std::string &file_name) const |
Find a material in this atlas (nullptr if not found). | |
std::shared_ptr< material > | add_material (const std::string &file_name, const material &mat) |
Add a new material to the atlas. | |
std::shared_ptr< font > | fetch_font (const std::string &font_name) const |
Find a font in this atlas (nullptr if not found). | |
bool | add_font (const std::string &font_name, std::shared_ptr< gui::font > fnt) |
Add a new font to the atlas. | |
std::size_t | get_page_count () const |
Return the number of pages in this atlas. | |
Protected Member Functions | |
virtual std::unique_ptr< atlas_page > | create_page_ ()=0 |
Create a new page in this atlas. | |
Protected Attributes | |
renderer & | renderer_ |
material::filter | filter_ = material::filter::none |
A class that holds multiple materials for efficient rendering.
This is an abstract class that must be implemented and created by the corresponding gui::renderer.
Definition at line 126 of file gui_atlas.hpp.
|
explicit |
Constructor.
rdr | The renderer with witch to create this atlas |
filt | Use texture filtering or not (see material::set_filter()) |
Definition at line 159 of file gui_atlas.cpp.
|
virtualdefault |
Destructor.
|
delete |
Non-copiable.
|
delete |
Non-movable.
bool lxgui::gui::atlas::add_font | ( | const std::string & | font_name, |
std::shared_ptr< gui::font > | fnt | ||
) |
Add a new font to the atlas.
font_name | The name of the font+size |
fnt | The font to add to this atlas |
Definition at line 208 of file gui_atlas.cpp.
std::shared_ptr< gui::material > lxgui::gui::atlas::add_material | ( | const std::string & | file_name, |
const material & | mat | ||
) |
Add a new material to the atlas.
file_name | The name of the file |
mat | The material to add to this atlas |
Definition at line 172 of file gui_atlas.cpp.
|
protectedpure virtual |
Create a new page in this atlas.
Implemented in lxgui::gui::gl::atlas, lxgui::gui::sdl::atlas, and lxgui::gui::sfml::atlas.
std::shared_ptr< gui::font > lxgui::gui::atlas::fetch_font | ( | const std::string & | font_name | ) | const |
Find a font in this atlas (nullptr if not found).
font_name | The name of the font+size |
Definition at line 198 of file gui_atlas.cpp.
std::shared_ptr< gui::material > lxgui::gui::atlas::fetch_material | ( | const std::string & | file_name | ) | const |
Find a material in this atlas (nullptr if not found).
file_name | The name of the file |
Definition at line 161 of file gui_atlas.cpp.
std::size_t lxgui::gui::atlas::get_page_count | ( | ) | const |
Return the number of pages in this atlas.
Definition at line 230 of file gui_atlas.cpp.
|
protected |
Definition at line 194 of file gui_atlas.hpp.
|
protected |
Definition at line 193 of file gui_atlas.hpp.