1 #ifndef LXGUI_GUI_SFML_RENDERER_HPP
2 #define LXGUI_GUI_SFML_RENDERER_HPP
4 #include "lxgui/gui_renderer.hpp"
5 #include "lxgui/impl/gui_sfml_render_target.hpp"
6 #include "lxgui/utils.hpp"
82 std::shared_ptr<gui::material>
120 std::shared_ptr<gui::material>
141 const std::string& font_file,
144 const std::vector<code_point_range>& code_points,
145 char32_t default_code_point)
override;
151 void begin_(std::shared_ptr<gui::render_target> target)
override;
191 const gui::material* mat,
const std::vector<std::array<vertex, 4>>& quad_list)
override;
213 const matrix4f& model_transform)
override;
216 sf::RenderWindow& window_;
219 std::shared_ptr<gui::sfml::render_target> current_target_;
220 sf::RenderTarget* current_sfml_target_ =
nullptr;
A class that holds rendering data.
Abstract type for implementation specific management.
SFML implementation of rendering.
std::shared_ptr< gui::material > create_material(const vector2ui &dimensions, const color32 *pixel_data, material::filter filt=material::filter::none) override
Creates a new material from arbitrary pixel data.
matrix4f get_view() const override
Returns the current view matrix to use when rendering (viewport).
std::shared_ptr< gui::vertex_cache > create_vertex_cache(gui::vertex_cache::type type) override
Creates a new empty vertex cache.
std::string get_name() const override
Returns a human-readable name for this renderer.
renderer(sf::RenderWindow &window)
Constructor.
std::size_t get_texture_max_size() const override
Returns the maximum texture width/height (in pixels).
std::shared_ptr< gui::render_target > create_render_target(const vector2ui &dimensions, material::filter filt=material::filter::none) override
Creates a new render target.
std::shared_ptr< gui::atlas > create_atlas_(material::filter filt) override
Creates a new atlas with a given texture filter mode.
void begin_(std::shared_ptr< gui::render_target > target) override
Begins rendering on a particular render target.
std::shared_ptr< gui::material > create_material(std::shared_ptr< gui::render_target > target, const bounds2f &location) override
Creates a new material from a portion of a render target.
void end_() override
Ends rendering.
bool is_texture_atlas_supported() const override
Checks if the renderer supports texture atlases natively.
std::shared_ptr< gui::font > create_font_(const std::string &font_file, std::size_t size, std::size_t outline, const std::vector< code_point_range > &code_points, char32_t default_code_point) override
Creates a new font.
void render_cache_(const gui::material *mat, const gui::vertex_cache &cache, const matrix4f &model_transform) override
Renders a vertex cache.
bool is_texture_vertex_color_supported() const override
Checks if the renderer supports setting colors for each vertex of a textured quad.
std::shared_ptr< gui::material > create_material_(const std::string &file_name, material::filter filt) override
Creates a new material from a texture file.
void notify_window_resized(const vector2ui &new_dimensions) override
Notifies the renderer that the render window has been resized.
void render_quads_(const gui::material *mat, const std::vector< std::array< vertex, 4 >> &quad_list) override
Renders a set of quads.
bool is_vertex_cache_supported() const override
Checks if the renderer supports vertex caches.
void set_view_(const matrix4f &view_matrix) override
Sets the view matrix to use when rendering (viewport).
An object representing cached vertex data on the GPU.
type
The type of vertex data contained in a vertex_cache.
Holds a single color (byte RGBA, 32 bits)
A 4x4 matrix, used for coordinate transformations.