TGUI  0.9-beta
tgui::BackendRenderTargetBase Class Referenceabstract

Base class for render targets. More...

#include <TGUI/BackendRenderTarget.hpp>

Public Member Functions

virtual ~BackendRenderTargetBase ()=default
 Virtual destructor.
 
virtual void setView (FloatRect view, FloatRect viewport)=0
 Informs the render target about which part of the window is used for rendering. More...
 
virtual void drawGui (const std::shared_ptr< RootContainer > &root)=0
 Draws the gui and all of its widgets. More...
 
virtual void drawWidget (const RenderStates &states, const std::shared_ptr< Widget > &widget)=0
 Draws a widget, if the widget is visible. More...
 
virtual void addClippingLayer (const RenderStates &states, FloatRect rect)=0
 Adds another clipping region. More...
 
virtual void removeClippingLayer ()=0
 Removes the last added clipping region. More...
 
virtual void drawBorders (const RenderStates &states, const Borders &borders, Vector2f size, Color color)
 Draws borders inside a provided rectangle. More...
 
virtual void drawFilledRect (const RenderStates &states, Vector2f size, Color color)
 Draws a colored rectangle. More...
 
virtual void drawSprite (const RenderStates &states, const Sprite &sprite)=0
 Draws a texture. More...
 
virtual void drawText (const RenderStates &states, const Text &text)=0
 Draws some text. More...
 
virtual void drawTriangles (const RenderStates &states, const Vertex *vertices, std::size_t vertexCount, const int *indices=nullptr, std::size_t indexCount=0)=0
 Draws one or more triangles (using the color that is specified in the vertices) More...
 
void drawTriangles (const RenderStates &states, std::initializer_list< Vertex > vertices, std::initializer_list< int > indices={})
 Draws one or more triangles (using the color that is specified in the vertices) More...
 
virtual void drawCircle (const RenderStates &states, float size, const Color &backgroundColor, float borderThickness=0, const Color &borderColor={})=0
 Draws a circle. More...
 

Detailed Description

Base class for render targets.

Member Function Documentation

◆ addClippingLayer()

virtual void tgui::BackendRenderTargetBase::addClippingLayer ( const RenderStates states,
FloatRect  rect 
)
pure virtual

Adds another clipping region.

Parameters
statesRender states to use for drawing
rectThe clipping region

If multiple clipping regions were added then contents is only shown in the intersection of all regions.

Warning
Every call to addClippingLayer must have a matching call to removeClippingLayer.

◆ drawBorders()

virtual void tgui::BackendRenderTargetBase::drawBorders ( const RenderStates states,
const Borders borders,
Vector2f  size,
Color  color 
)
virtual

Draws borders inside a provided rectangle.

Parameters
statesRender states to use for drawing
bordersThe size of the borders on each side
sizeThe size of the rectangle in which borders will be drawn
colorColor of the borders

◆ drawCircle()

virtual void tgui::BackendRenderTargetBase::drawCircle ( const RenderStates states,
float  size,
const Color backgroundColor,
float  borderThickness = 0,
const Color borderColor = {} 
)
pure virtual

Draws a circle.

Parameters
statesRender states to use for drawing
sizeDiameter of the circle
backgroundColorColor to fill the circle with
borderThicknessThickness of the border to draw around the circle (outside given size if thickness is positive)
borderColorColor of the border, if borderThickness differs from 0

◆ drawFilledRect()

virtual void tgui::BackendRenderTargetBase::drawFilledRect ( const RenderStates states,
Vector2f  size,
Color  color 
)
virtual

Draws a colored rectangle.

Parameters
statesRender states to use for drawing
sizeSize of the rectangle
colorColor of the rectangle

◆ drawGui()

virtual void tgui::BackendRenderTargetBase::drawGui ( const std::shared_ptr< RootContainer > &  root)
pure virtual

Draws the gui and all of its widgets.

Parameters
rootRoot container that holds all widgets in the gui

◆ drawSprite()

virtual void tgui::BackendRenderTargetBase::drawSprite ( const RenderStates states,
const Sprite sprite 
)
pure virtual

Draws a texture.

Parameters
statesRender states to use for drawing
spriteImage to draw

◆ drawText()

virtual void tgui::BackendRenderTargetBase::drawText ( const RenderStates states,
const Text text 
)
pure virtual

Draws some text.

Parameters
statesRender states to use for drawing
textText to draw

◆ drawTriangles() [1/2]

virtual void tgui::BackendRenderTargetBase::drawTriangles ( const RenderStates states,
const Vertex vertices,
std::size_t  vertexCount,
const int *  indices = nullptr,
std::size_t  indexCount = 0 
)
pure virtual

Draws one or more triangles (using the color that is specified in the vertices)

Parameters
statesRender states to use for drawing
verticesPointer to first element in array of vertices
vertexCountAmount of elements in the vertex array
indicesPointer to first element in array of indices
indexCountAmount of elements in the indices array

If indices is a nullptr then vertexCount must be a multiple of 3 and each set of 3 vertices will be seen as a triangle.

◆ drawTriangles() [2/2]

void tgui::BackendRenderTargetBase::drawTriangles ( const RenderStates states,
std::initializer_list< Vertex vertices,
std::initializer_list< int >  indices = {} 
)

Draws one or more triangles (using the color that is specified in the vertices)

Parameters
statesRender states to use for drawing
verticesArray of vertices
indicesOptional array of indices

This function is provided for convenience and just calls the other drawTriangles function.

◆ drawWidget()

virtual void tgui::BackendRenderTargetBase::drawWidget ( const RenderStates states,
const std::shared_ptr< Widget > &  widget 
)
pure virtual

Draws a widget, if the widget is visible.

Parameters
statesRender states to use for drawing
widgetThe widget to draw

◆ removeClippingLayer()

virtual void tgui::BackendRenderTargetBase::removeClippingLayer ( )
pure virtual

Removes the last added clipping region.

Warning
The addClippingLayer function must have been called before calling this function.

◆ setView()

virtual void tgui::BackendRenderTargetBase::setView ( FloatRect  view,
FloatRect  viewport 
)
pure virtual

Informs the render target about which part of the window is used for rendering.

Parameters
viewDefines which part of the gui is being shown
viewportDefines which part of the window is being rendered to

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