lxgui
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
lxgui::gui::sfml::atlas Class Referencefinal

A class that holds rendering data This implementation can contain either a plain color or a real sf::Texture. It is also used by the gui::sfml::render_target class to store the output data. More...

#include <gui_sfml_atlas.hpp>

Inheritance diagram for lxgui::gui::sfml::atlas:
lxgui::gui::atlas

Public Member Functions

 atlas (renderer &rdr, material::filter filt)
 Constructor for textures. More...
 
 atlas (const atlas &tex)=delete
 
 atlas (atlas &&tex)=delete
 
atlasoperator= (const atlas &tex)=delete
 
atlasoperator= (atlas &&tex)=delete
 
std::shared_ptr< materialfetch_material (const std::string &file_name) const
 Find a material in this atlas (nullptr if not found). More...
 
std::shared_ptr< materialadd_material (const std::string &file_name, const material &mat)
 Add a new material to the atlas. More...
 
std::shared_ptr< fontfetch_font (const std::string &font_name) const
 Find a font in this atlas (nullptr if not found). More...
 
bool add_font (const std::string &font_name, std::shared_ptr< gui::font > fnt)
 Add a new font to the atlas. More...
 
std::size_t get_page_count () const
 Return the number of pages in this atlas. More...
 

Protected Member Functions

std::unique_ptr< gui::atlas_pagecreate_page_ () override
 Create a new page in this atlas. More...
 

Protected Attributes

rendererrenderer_
 
material::filter filter_ = material::filter::none
 

Detailed Description

A class that holds rendering data This implementation can contain either a plain color or a real sf::Texture. It is also used by the gui::sfml::render_target class to store the output data.

Definition at line 56 of file gui_sfml_atlas.hpp.

Constructor & Destructor Documentation

◆ atlas() [1/3]

lxgui::gui::sfml::atlas::atlas ( renderer rdr,
material::filter  filt 
)
explicit

Constructor for textures.

Parameters
rdrThe renderer with witch to create this atlas
filtUse texture filtering or not (see set_filter())

◆ atlas() [2/3]

lxgui::gui::sfml::atlas::atlas ( const atlas tex)
delete

◆ atlas() [3/3]

lxgui::gui::sfml::atlas::atlas ( atlas &&  tex)
delete

Member Function Documentation

◆ add_font()

bool lxgui::gui::atlas::add_font ( const std::string &  font_name,
std::shared_ptr< gui::font fnt 
)
inherited

Add a new font to the atlas.

Parameters
font_nameThe name of the font+size
fntThe font to add to this atlas
Returns
'true' if the font was added to this atlas, 'false' otherwise

Definition at line 208 of file gui_atlas.cpp.

◆ add_material()

std::shared_ptr< gui::material > lxgui::gui::atlas::add_material ( const std::string &  file_name,
const material mat 
)
inherited

Add a new material to the atlas.

Parameters
file_nameThe name of the file
matThe material to add to this atlas
Returns
The new material

Definition at line 172 of file gui_atlas.cpp.

◆ create_page_()

std::unique_ptr<gui::atlas_page> lxgui::gui::sfml::atlas::create_page_ ( )
overrideprotectedvirtual

Create a new page in this atlas.

Returns
The new page, added at the back of the page list

Implements lxgui::gui::atlas.

◆ fetch_font()

std::shared_ptr< gui::font > lxgui::gui::atlas::fetch_font ( const std::string &  font_name) const
inherited

Find a font in this atlas (nullptr if not found).

Parameters
font_nameThe name of the font+size
Returns
The font (nullptr if not found)

Definition at line 198 of file gui_atlas.cpp.

◆ fetch_material()

std::shared_ptr< gui::material > lxgui::gui::atlas::fetch_material ( const std::string &  file_name) const
inherited

Find a material in this atlas (nullptr if not found).

Parameters
file_nameThe name of the file
Returns
The material (nullptr if not found)

Definition at line 161 of file gui_atlas.cpp.

◆ get_page_count()

std::size_t lxgui::gui::atlas::get_page_count ( ) const
inherited

Return the number of pages in this atlas.

Returns
The number of pages in this atlas

Definition at line 230 of file gui_atlas.cpp.

◆ operator=() [1/2]

atlas& lxgui::gui::sfml::atlas::operator= ( atlas &&  tex)
delete

◆ operator=() [2/2]

atlas& lxgui::gui::sfml::atlas::operator= ( const atlas tex)
delete

Member Data Documentation

◆ filter_

material::filter lxgui::gui::atlas::filter_ = material::filter::none
protectedinherited

Definition at line 194 of file gui_atlas.hpp.

◆ renderer_

renderer& lxgui::gui::atlas::renderer_
protectedinherited

Definition at line 193 of file gui_atlas.hpp.


The documentation for this class was generated from the following file: