lxgui
|
A single texture holding multiple materials for efficient rendering. More...
#include <gui_atlas.hpp>
Public Member Functions | |
atlas_page (material::filter filt) | |
Constructor. | |
virtual | ~atlas_page ()=default |
Destructor. | |
atlas_page (const atlas_page &)=delete | |
Non-copiable. | |
atlas_page (atlas_page &&)=delete | |
Non-movable. | |
atlas_page & | operator= (const atlas_page &)=delete |
Non-copiable. | |
atlas_page & | operator= (atlas_page &&)=delete |
Non-movable. | |
std::shared_ptr< material > | fetch_material (const std::string &file_name) const |
Find a material in this page (nullptr if not found). | |
std::shared_ptr< material > | add_material (const std::string &file_name, const material &mat) |
Creates a new material from a texture file. | |
std::shared_ptr< font > | fetch_font (const std::string &font_name) const |
Find a font in this page (nullptr if not found). | |
bool | add_font (const std::string &font_name, std::shared_ptr< gui::font > fnt) |
Creates a new font from a texture file. | |
bool | empty () const |
Checks if this page is empty (contains no materials). | |
Protected Member Functions | |
virtual std::shared_ptr< material > | add_material_ (const material &mat, const bounds2f &location)=0 |
Adds a new material to this page, at the provided location. | |
virtual float | get_width_ () const =0 |
Return the width of this page (in pixels). | |
virtual float | get_height_ () const =0 |
Return the height of this page (in pixels). | |
Protected Attributes | |
material::filter | filter_ = material::filter::none |
A single texture holding multiple materials for efficient rendering.
This is an abstract class that must be implemented and created by the corresponding gui::renderer.
Definition at line 25 of file gui_atlas.hpp.
|
explicit |
Constructor.
filt | Use texture filtering or not (see material::set_filter()) |
Definition at line 12 of file gui_atlas.cpp.
|
virtualdefault |
Destructor.
Reimplemented in lxgui::gui::gl::atlas_page, and lxgui::gui::sdl::atlas_page.
|
delete |
Non-copiable.
|
delete |
Non-movable.
bool lxgui::gui::atlas_page::add_font | ( | const std::string & | font_name, |
std::shared_ptr< gui::font > | fnt | ||
) |
Creates a new font from a texture file.
font_name | The name of the file |
fnt | The font to add to this page |
Definition at line 51 of file gui_atlas.cpp.
std::shared_ptr< gui::material > lxgui::gui::atlas_page::add_material | ( | const std::string & | file_name, |
const material & | mat | ||
) |
Creates a new material from a texture file.
file_name | The name of the file |
mat | The material to add to this page |
Definition at line 25 of file gui_atlas.cpp.
|
protectedpure virtual |
Adds a new material to this page, at the provided location.
mat | The material to add |
location | The position at which to insert this material |
Implemented in lxgui::gui::gl::atlas_page, lxgui::gui::sdl::atlas_page, and lxgui::gui::sfml::atlas_page.
bool lxgui::gui::atlas_page::empty | ( | ) | const |
Checks if this page is empty (contains no materials).
Definition at line 72 of file gui_atlas.cpp.
std::shared_ptr< font > lxgui::gui::atlas_page::fetch_font | ( | const std::string & | font_name | ) | const |
Find a font in this page (nullptr if not found).
font_name | The name+size of the font |
Definition at line 41 of file gui_atlas.cpp.
std::shared_ptr< material > lxgui::gui::atlas_page::fetch_material | ( | const std::string & | file_name | ) | const |
Find a material in this page (nullptr if not found).
file_name | The name of the file |
Definition at line 14 of file gui_atlas.cpp.
|
protectedpure virtual |
Return the height of this page (in pixels).
Implemented in lxgui::gui::gl::atlas_page, lxgui::gui::sdl::atlas_page, and lxgui::gui::sfml::atlas_page.
|
protectedpure virtual |
Return the width of this page (in pixels).
Implemented in lxgui::gui::gl::atlas_page, lxgui::gui::sdl::atlas_page, and lxgui::gui::sfml::atlas_page.
|
delete |
Non-movable.
|
delete |
Non-copiable.
|
protected |
Definition at line 106 of file gui_atlas.hpp.