1 #ifndef LXGUI_GUI_SFML_MATERIAL_HPP
2 #define LXGUI_GUI_SFML_MATERIAL_HPP
4 #include "lxgui/gui_bounds2.hpp"
5 #include "lxgui/gui_color.hpp"
6 #include "lxgui/gui_material.hpp"
7 #include "lxgui/utils.hpp"
9 #include <SFML/Graphics/Image.hpp>
10 #include <SFML/Graphics/RenderTexture.hpp>
11 #include <SFML/Graphics/Texture.hpp>
34 bool is_render_target,
154 bool is_render_target_ =
false;
155 sf::RenderTexture render_texture_;
156 sf::Texture texture_;
157 const sf::Texture* atlas_texture_ =
nullptr;
159 static const std::size_t maximum_size;
A class that holds rendering data.
A class that holds rendering data This implementation can contain either a plain color or a real sf::...
static void premultiply_alpha(sf::Image &data)
Premultiplies an image by its alpha component.
material & operator=(material &&tex)=delete
bool set_dimensions(const vector2ui &dimensions)
Resizes this texture.
material(const sf::Texture &texture, const bounds2f &location, filter filt=filter::none)
Constructor for atlas textures.
void set_filter(filter filt)
Sets the filter mode of this texture.
bounds2f get_rect() const override
Returns the pixel rect in pixels of the canvas containing this texture (if any).
bool uses_same_texture(const gui::material &other) const override
Checks if another material is based on the same texture as the current material.
vector2ui get_canvas_dimensions() const override
Returns the physical dimensions (in pixels) of the canvas containing this texture (if any).
material(material &&tex)=delete
void update_texture(const color32 *data)
Updates the texture that is in GPU memory.
material(const vector2ui &dimensions, bool is_render_target, wrap wrp=wrap::repeat, filter filt=filter::none)
Constructor for textures.
filter get_filter() const
Returns the filter mode of this texture.
material(const std::string &file_name, wrap wrp=wrap::repeat, filter filt=filter::none)
Constructor for textures.
material(const material &tex)=delete
sf::RenderTexture * get_render_texture()
Returns the underlying SFML render texture object. return The underlying SFML render texture object.
material(const sf::Image &data, wrap wrp=wrap::repeat, filter filt=filter::none)
Constructor for textures.
void set_wrap(wrap wrp)
Sets the wrap mode of this texture.
const sf::Texture * get_texture() const
Returns the underlying SFML texture object. return The underlying SFML texture object.
material & operator=(const material &tex)=delete
A layered_region that can draw images and colored rectangles.
Holds a single color (byte RGBA, 32 bits)