|
TGUI
0.9.5
|
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) |
| Informs the render target about which part of the window is used for rendering. | |
| virtual void | setView (FloatRect view, FloatRect viewport, Vector2f targetSize) |
| Informs the render target about which part of the window is used for rendering. | |
| virtual void | drawGui (const std::shared_ptr< RootContainer > &root)=0 |
| Draws the gui and all of its widgets. | |
| virtual void | drawWidget (const RenderStates &states, const std::shared_ptr< Widget > &widget) |
| Draws a widget, if the widget is visible. | |
| virtual void | addClippingLayer (const RenderStates &states, FloatRect rect) |
| Adds another clipping region. | |
| virtual void | removeClippingLayer () |
| Removes the last added clipping region. | |
| virtual void | drawBorders (const RenderStates &states, const Borders &borders, Vector2f size, Color color) |
| Draws borders inside a provided rectangle. | |
| virtual void | drawFilledRect (const RenderStates &states, Vector2f size, Color color) |
| Draws a colored rectangle. | |
| virtual void | drawSprite (const RenderStates &states, const Sprite &sprite)=0 |
| Draws a texture. | |
| virtual void | drawText (const RenderStates &states, const Text &text)=0 |
| Draws some text. | |
| 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) | |
| 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) | |
| virtual void | drawCircle (const RenderStates &states, float size, const Color &backgroundColor, float borderThickness=0, const Color &borderColor={}) |
| Draws a circle. | |
| 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. | |
Protected Member Functions | |
| virtual void | updateClipping (FloatRect clipRect, FloatRect clipViewport) |
| Called from addClippingLayer and removeClippingLayer to apply the clipping. | |
Protected Attributes | |
| FloatRect | m_viewRect |
| FloatRect | m_viewport |
| Vector2f | m_targetSize |
| std::vector< std::pair< FloatRect, FloatRect > > | m_clipLayers |
Base class for render targets.
|
virtual |
Adds another clipping region.
| 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.
|
virtual |
Draws borders inside a provided rectangle.
| 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 |
|
virtual |
Draws a circle.
|
virtual |
Draws a colored rectangle.
| states | Render states to use for drawing |
| size | Size of the rectangle |
| color | Color of the rectangle |
|
pure virtual |
Draws the gui and all of its widgets.
| root | Root container that holds all widgets in the gui |
|
virtual |
Draws a rounded rectangle.
| 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 |
|
pure virtual |
Draws a texture.
| states | Render states to use for drawing |
| sprite | Image to draw |
|
pure virtual |
Draws some text.
| states | Render states to use for drawing |
| text | Text to draw |
|
pure virtual |
Draws one or more triangles (using the color that is specified in the vertices)
| 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.
| 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)
| 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.
|
virtual |
Draws a widget, if the widget is visible.
| states | Render states to use for drawing |
| widget | The widget to draw |
|
virtual |
Removes the last added clipping region.
Informs the render target about which part of the window is used for rendering.
| view | Defines which part of the gui is being shown |
| viewport | Defines which part of the window is being rendered to |
|
virtual |
Informs the render target about which part of the window is used for rendering.
| view | Defines which part of the gui is being shown |
| viewport | Defines which part of the window is being rendered to |
| targetSize | Size of the window |
|
inlineprotectedvirtual |
Called from addClippingLayer and removeClippingLayer to apply the clipping.
| clipRect | View rectangle to apply |
| clipViewport | Viewport to apply |
Both rectangles may be empty when nothing that will be drawn is going to be visible.
1.9.8