lxgui
Public Member Functions | List of all members
lxgui::gui::sfml::render_target Class Referencefinal

A place to render things (the screen, a texture, ...) More...

#include <gui_sfml_render_target.hpp>

Inheritance diagram for lxgui::gui::sfml::render_target:
lxgui::gui::render_target

Public Member Functions

 render_target (const vector2ui &dimensions, material::filter filt=material::filter::none)
 Constructor. More...
 
void begin () override
 Begins rendering on this target. More...
 
void end () override
 Ends rendering on this target. More...
 
void clear (const color &c) override
 Clears the content of this render_target. More...
 
bounds2f get_rect () const override
 Returns this render target's pixel rect. More...
 
bool set_dimensions (const vector2ui &dimensions) override
 Sets this render target's dimensions. More...
 
void save_to_file (std::string filename) const override
 Saves the content of this render target into a file. More...
 
vector2ui get_canvas_dimensions () const override
 Returns this render target's canvas dimension. More...
 
std::weak_ptr< sfml::materialget_material ()
 Returns the associated texture for rendering. More...
 
sf::RenderTexture * get_render_texture ()
 Returns the underlying SFML render texture object. return The underlying SFML render texture object. More...
 

Detailed Description

A place to render things (the screen, a texture, ...)

Definition at line 23 of file gui_sfml_render_target.hpp.

Constructor & Destructor Documentation

◆ render_target()

lxgui::gui::sfml::render_target::render_target ( const vector2ui dimensions,
material::filter  filt = material::filter::none 
)

Constructor.

Parameters
dimensionsThe dimensions of the render_target
filtThe filtering to apply to the target texture when displayed

Member Function Documentation

◆ begin()

void lxgui::gui::sfml::render_target::begin ( )
overridevirtual

Begins rendering on this target.

Implements lxgui::gui::render_target.

◆ clear()

void lxgui::gui::sfml::render_target::clear ( const color c)
overridevirtual

Clears the content of this render_target.

Parameters
cThe color to use as background

Implements lxgui::gui::render_target.

◆ end()

void lxgui::gui::sfml::render_target::end ( )
overridevirtual

Ends rendering on this target.

Implements lxgui::gui::render_target.

◆ get_canvas_dimensions()

vector2ui lxgui::gui::sfml::render_target::get_canvas_dimensions ( ) const
overridevirtual

Returns this render target's canvas dimension.

Returns
This render target's canvas dimension
Note
This is the physical size of the render target. On some systems, abitrary dimensions are not supported: they can be promoted to the nearest power of two from for example.

Implements lxgui::gui::render_target.

◆ get_material()

std::weak_ptr<sfml::material> lxgui::gui::sfml::render_target::get_material ( )

Returns the associated texture for rendering.

Returns
The underlying pixel buffer, that you can use to render its content

◆ get_rect()

bounds2f lxgui::gui::sfml::render_target::get_rect ( ) const
overridevirtual

Returns this render target's pixel rect.

Returns
This render target's pixel rect

Implements lxgui::gui::render_target.

◆ get_render_texture()

sf::RenderTexture* lxgui::gui::sfml::render_target::get_render_texture ( )

Returns the underlying SFML render texture object. return The underlying SFML render texture object.

◆ save_to_file()

void lxgui::gui::sfml::render_target::save_to_file ( std::string  filename) const
overridevirtual

Saves the content of this render target into a file.

Parameters
filenameThe path of the file to save to
Note
The file format will be detected based on the extension. Not all renderer backends support all extensions.

Implements lxgui::gui::render_target.

◆ set_dimensions()

bool lxgui::gui::sfml::render_target::set_dimensions ( const vector2ui dimensions)
overridevirtual

Sets this render target's dimensions.

Parameters
dimensionsThe new dimensions (in pixels)
Returns
'true' if the function had to re-create a new render target

Implements lxgui::gui::render_target.


The documentation for this class was generated from the following file: