A class that holds rendering data.
More...
#include <gui_material.hpp>
A class that holds rendering data.
This is an abstract class that must be implemented and created by the corresponding gui::renderer.
Definition at line 16 of file gui_material.hpp.
◆ filter
◆ wrap
◆ material() [1/3]
lxgui::gui::material::material |
( |
bool |
is_atlas | ) |
|
|
explicit |
Constructor.
- Parameters
-
is_atlas | 'true' if this material comes from an atlas, 'false' otherwise |
Definition at line 5 of file gui_material.cpp.
◆ ~material()
virtual lxgui::gui::material::~material |
( |
| ) |
|
|
virtualdefault |
◆ material() [2/3]
lxgui::gui::material::material |
( |
const material & |
| ) |
|
|
delete |
◆ material() [3/3]
lxgui::gui::material::material |
( |
material && |
| ) |
|
|
delete |
◆ get_canvas_dimensions()
virtual vector2ui lxgui::gui::material::get_canvas_dimensions |
( |
| ) |
const |
|
pure virtual |
Returns the physical dimensions (in pixels) of the canvas containing this texture (if any).
- Returns
- The physical dimensions (in pixels) of the canvas containing this (if any)
- Note
- When a texture is loaded, most of the time it will fill the entire "canvas", namely, the 2D pixel array containing the texture data. However, some old hardware don't support textures that have non power-of-two dimensions. If the user creates a material for such a texture, the gui::renderer will create a bigger canvas that has power-of-two dimensions, and store the texture in it. Likewise, if a texture is placed in a wider texture atlas, the canvas will contain more than one texture.
Implemented in lxgui::gui::gl::material, lxgui::gui::sdl::material, and lxgui::gui::sfml::material.
◆ get_canvas_uv()
vector2f lxgui::gui::material::get_canvas_uv |
( |
const vector2f & |
texture_uv, |
|
|
bool |
from_normalized |
|
) |
| const |
Returns normalized UV coordinates on the canvas, given local UV coordinates.
- Parameters
-
texture_uv | The original UV coordinates, local to this texture |
from_normalized | Set to 'true' if input coordinates are normalized |
- Note
- Normalized coordinates range from 0 to 1, with 1 corresponding to the width/height of the texture, while non-normalized coordinates are in pixels.
Definition at line 7 of file gui_material.cpp.
◆ get_local_uv()
vector2f lxgui::gui::material::get_local_uv |
( |
const vector2f & |
canvas_uv, |
|
|
bool |
as_normalized |
|
) |
| const |
Returns local UV coordinates on the texture, given canvas UV coordinates.
- Parameters
-
canvas_uv | The canvas UV coordinates |
as_normalized | Set to 'true' if output coordinates should be normalized |
- Note
- Normalized coordinates range from 0 to 1, with 1 corresponding to the width/height of the texture, while non-normalized coordinates are in pixels.
Definition at line 20 of file gui_material.cpp.
◆ get_rect()
virtual bounds2f lxgui::gui::material::get_rect |
( |
| ) |
const |
|
pure virtual |
◆ is_in_atlas()
bool lxgui::gui::material::is_in_atlas |
( |
| ) |
const |
Checks if the material is embedded in an atlas.
- Returns
- 'true' if the material is inside an atlas, 'false' otherwise.
Definition at line 33 of file gui_material.cpp.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ uses_same_texture()
virtual bool lxgui::gui::material::uses_same_texture |
( |
const material & |
other | ) |
const |
|
pure virtual |
◆ is_atlas_
bool lxgui::gui::material::is_atlas_ = false |
|
protected |
The documentation for this class was generated from the following files: