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

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

#include <gui_render_target.hpp>

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

Public Member Functions

 render_target ()=default
 Constructor. More...
 
virtual ~render_target ()=default
 Destructor. More...
 
 render_target (const render_target &)=delete
 Non-copiable. More...
 
 render_target (render_target &&)=delete
 Non-movable. More...
 
render_targetoperator= (const render_target &)=delete
 Non-copiable. More...
 
render_targetoperator= (render_target &&)=delete
 Non-movable. More...
 
virtual void begin ()=0
 Begins rendering on this target. More...
 
virtual void end ()=0
 Ends rendering on this target. More...
 
virtual void clear (const color &c)=0
 Clears the content of this render_target. More...
 
virtual bounds2f get_rect () const =0
 Returns this render target's pixel rect. More...
 
virtual bool set_dimensions (const vector2ui &dimensions)=0
 Sets this render target's dimensions. More...
 
virtual vector2ui get_canvas_dimensions () const =0
 Returns this render target's canvas dimension. More...
 
virtual void save_to_file (std::string filename) const =0
 Saves the content of this render target into a file. More...
 

Detailed Description

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

Note
This is an abstract class that must be inherited from and created by the corresponding gui::renderer.

Definition at line 16 of file gui_render_target.hpp.

Constructor & Destructor Documentation

◆ render_target() [1/3]

lxgui::gui::render_target::render_target ( )
default

Constructor.

◆ ~render_target()

virtual lxgui::gui::render_target::~render_target ( )
virtualdefault

Destructor.

Reimplemented in lxgui::gui::gl::render_target.

◆ render_target() [2/3]

lxgui::gui::render_target::render_target ( const render_target )
delete

Non-copiable.

◆ render_target() [3/3]

lxgui::gui::render_target::render_target ( render_target &&  )
delete

Non-movable.

Member Function Documentation

◆ begin()

virtual void lxgui::gui::render_target::begin ( )
pure virtual

◆ clear()

virtual void lxgui::gui::render_target::clear ( const color c)
pure virtual

Clears the content of this render_target.

Parameters
cThe color to use as background

Implemented in lxgui::gui::sfml::render_target, lxgui::gui::sdl::render_target, and lxgui::gui::gl::render_target.

◆ end()

virtual void lxgui::gui::render_target::end ( )
pure virtual

◆ get_canvas_dimensions()

virtual vector2ui lxgui::gui::render_target::get_canvas_dimensions ( ) const
pure virtual

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.

Implemented in lxgui::gui::sfml::render_target, lxgui::gui::sdl::render_target, and lxgui::gui::gl::render_target.

◆ get_rect()

virtual bounds2f lxgui::gui::render_target::get_rect ( ) const
pure virtual

Returns this render target's pixel rect.

Returns
This render target's pixel rect

Implemented in lxgui::gui::sfml::render_target, lxgui::gui::sdl::render_target, and lxgui::gui::gl::render_target.

◆ operator=() [1/2]

render_target& lxgui::gui::render_target::operator= ( const render_target )
delete

Non-copiable.

◆ operator=() [2/2]

render_target& lxgui::gui::render_target::operator= ( render_target &&  )
delete

Non-movable.

◆ save_to_file()

virtual void lxgui::gui::render_target::save_to_file ( std::string  filename) const
pure virtual

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.

Implemented in lxgui::gui::sfml::render_target, lxgui::gui::sdl::render_target, and lxgui::gui::gl::render_target.

◆ set_dimensions()

virtual bool lxgui::gui::render_target::set_dimensions ( const vector2ui dimensions)
pure virtual

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

Implemented in lxgui::gui::sfml::render_target, lxgui::gui::sdl::render_target, and lxgui::gui::gl::render_target.


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