1 #ifndef LXGUI_GUI_SDL_RENDERER_HPP
2 #define LXGUI_GUI_SDL_RENDERER_HPP
4 #include "lxgui/gui_matrix4.hpp"
5 #include "lxgui/gui_renderer.hpp"
6 #include "lxgui/impl/gui_sdl_render_target.hpp"
7 #include "lxgui/utils.hpp"
25 explicit renderer(SDL_Renderer* rdr,
bool initialise_sdl_image);
80 std::shared_ptr<gui::material>
124 std::shared_ptr<gui::material>
145 const std::string& font_file,
148 const std::vector<code_point_range>& code_points,
149 char32_t default_code_point)
override;
155 void begin_(std::shared_ptr<gui::render_target> target)
override;
204 const gui::material* mat,
const std::vector<std::array<vertex, 4>>& quad_list)
override;
226 const matrix4f& model_transform)
override;
229 SDL_Renderer* renderer_ =
nullptr;
230 bool pre_multiplied_alpha_supported_ =
false;
231 std::size_t texture_max_size_ = 0u;
238 std::shared_ptr<gui::sdl::render_target> current_target_;
A class that holds rendering data.
Abstract type for implementation specific management.
A class that holds rendering data This implementation can contain either a plain color or a real SDL_...
SDL implementation of rendering.
bool is_texture_vertex_color_supported() const override
Checks if the renderer supports setting colors for each vertex of a textured quad.
SDL_Renderer * get_sdl_renderer() const
Returns the SDL renderer implementation.
void render_quad_(const sdl::material *mat, const std::array< vertex, 4 > &vertex_list)
Renders a quad from a material and array of vertices.
void begin_(std::shared_ptr< gui::render_target > target) override
Begins rendering on a particular render target.
renderer(SDL_Renderer *rdr, bool initialise_sdl_image)
Constructor.
void render_cache_(const gui::material *mat, const gui::vertex_cache &cache, const matrix4f &model_transform) override
Renders a vertex cache.
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.
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 set_view_(const matrix4f &view_matrix) override
Sets the view matrix to use when rendering (viewport).
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.
std::shared_ptr< gui::atlas > create_atlas_(material::filter filt) override
Creates a new atlas with a given texture filter mode.
std::shared_ptr< gui::render_target > create_render_target(const vector2ui &dimensions, material::filter filt=material::filter::none) override
Creates a new render target.
void render_quads_(const gui::material *mat, const std::vector< std::array< vertex, 4 >> &quad_list) override
Renders a set of quads.
matrix4f get_view() const override
Returns the current view matrix to use when rendering (viewport).
void end_() override
Ends rendering.
std::size_t get_texture_max_size() const override
Returns the maximum texture width/height (in pixels).
bool is_vertex_cache_supported() const override
Checks if the renderer supports vertex caches.
bool is_texture_atlas_supported() const override
Checks if the renderer supports texture atlases natively.
std::string get_name() const override
Returns a human-readable name for this renderer.
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.
std::shared_ptr< gui::vertex_cache > create_vertex_cache(gui::vertex_cache::type type) override
Creates a new empty vertex cache.
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.