Base class for render targets.
More...
#include <TGUI/BackendRenderTarget.hpp>
|
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={}) |
| Draws a circle. More...
|
|
virtual void | drawRoundedRectangle (const RenderStates &states, const Vector2f &size, const Color &backgroundColor, float radius, const Borders &borders={0}, const Color &borderColor=Color::Black) |
| Draws a rounded rectangle. More...
|
|
Base class for render targets.
◆ addClippingLayer()
virtual void tgui::BackendRenderTargetBase::addClippingLayer |
( |
const RenderStates & |
states, |
|
|
FloatRect |
rect |
|
) |
| |
|
pure virtual |
Adds another clipping region.
- Parameters
-
states | Render states to use for drawing |
rect | The 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()
Draws borders inside a provided rectangle.
- Parameters
-
states | Render states to use for drawing |
borders | The size of the borders on each side |
size | The size of the rectangle in which borders will be drawn |
color | Color of the borders |
◆ drawCircle()
virtual void tgui::BackendRenderTargetBase::drawCircle |
( |
const RenderStates & |
states, |
|
|
float |
size, |
|
|
const Color & |
backgroundColor, |
|
|
float |
borderThickness = 0 , |
|
|
const Color & |
borderColor = {} |
|
) |
| |
|
virtual |
Draws a circle.
- Parameters
-
states | Render states to use for drawing |
size | Diameter of the circle |
backgroundColor | Color to fill the circle with |
borderThickness | Thickness of the border to draw around the circle (outside given size if thickness is positive) |
borderColor | Color of the border, if borderThickness differs from 0 |
◆ drawFilledRect()
Draws a colored rectangle.
- Parameters
-
states | Render states to use for drawing |
size | Size of the rectangle |
color | Color 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
-
root | Root container that holds all widgets in the gui |
◆ drawRoundedRectangle()
Draws a rounded rectangle.
- Parameters
-
states | Render states to use for drawing |
size | Size of the rectangle (includes borders) |
backgroundColor | Fill color of the rectangle |
radius | Radius of the rounded corners |
borders | Optional borders on the sides of the rectangle (must be the same on all sides) |
borderColor | Color of the borders |
◆ drawSprite()
virtual void tgui::BackendRenderTargetBase::drawSprite |
( |
const RenderStates & |
states, |
|
|
const Sprite & |
sprite |
|
) |
| |
|
pure virtual |
Draws a texture.
- Parameters
-
states | Render states to use for drawing |
sprite | Image to draw |
◆ drawText()
virtual void tgui::BackendRenderTargetBase::drawText |
( |
const RenderStates & |
states, |
|
|
const Text & |
text |
|
) |
| |
|
pure virtual |
Draws some text.
- Parameters
-
states | Render states to use for drawing |
text | Text 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
-
states | Render states to use for drawing |
vertices | Pointer to first element in array of vertices |
vertexCount | Amount of elements in the vertex array |
indices | Pointer to first element in array of indices |
indexCount | Amount 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
-
states | Render states to use for drawing |
vertices | Array of vertices |
indices | Optional 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
-
states | Render states to use for drawing |
widget | The 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
-
view | Defines which part of the gui is being shown |
viewport | Defines which part of the window is being rendered to |
The documentation for this class was generated from the following file: