1 #ifndef LXGUI_GUI_GL_MATERIAL_HPP
2 #define LXGUI_GUI_GL_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"
38 std::uint32_t texture_handle,
145 std::uint32_t texture_handle_ = 0u;
147 bool is_owner_ =
false;
149 static bool only_power_of_two;
150 static std::size_t maximum_size;
A class that holds rendering data This implementation can contain either a plain color or a real Open...
material(const vector2ui &dimensions, wrap wrp=wrap::repeat, filter filt=filter::none)
Constructor for textures.
material & operator=(const material &tex)=delete
void update_texture(const color32 *data)
Updates the texture that is in GPU memory.
static void check_availability()
Checks if the machine is capable of using some features.
bounds2f get_rect() const override
Returns the pixel rect in pixels of the canvas containing this texture (if any).
~material() override
Destructor.
static std::size_t get_max_size()
Returns the maximum size available for a texture, in pixels.
material(const material &tex)=delete
bool set_dimensions(const vector2ui &dimensions)
Resizes this texture.
std::uint32_t get_handle() const
Returns the OpenGL texture handle.
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).
void set_filter(filter filt)
Sets the filter mode of this texture.
material(std::uint32_t texture_handle, const vector2ui &canvas_dimensions, const bounds2f rect, filter filt=filter::none)
Constructor for atlas textures.
filter get_filter() const
Returns the filter mode of this texture.
void bind() const
Sets this material as the active one.
material & operator=(material &&tex)=delete
void set_wrap(wrap wrp)
Sets the wrap mode of this texture.
static void premultiply_alpha(std::vector< color32 > &data)
Premultiplies the texture by alpha component.
material(material &&tex)=delete
A class that holds rendering data.
Holds a single color (byte RGBA, 32 bits)