26#ifndef TGUI_BACKEND_RENDER_TARGET_HPP
27#define TGUI_BACKEND_RENDER_TARGET_HPP
29#include <TGUI/Rect.hpp>
30#include <TGUI/Color.hpp>
31#include <TGUI/Sprite.hpp>
32#include <TGUI/Text.hpp>
33#include <TGUI/Outline.hpp>
34#include <TGUI/RenderStates.hpp>
62 virtual void setClearColor(
const tgui::Color& color) = 0;
71 virtual void clearScreen() = 0;
76#ifndef TGUI_REMOVE_DEPRECATED_CODE
83 TGUI_DEPRECATED(
"Use setView(view, viewport, targetSize) instead") virtual
void setView(
FloatRect view,
FloatRect viewport);
101 virtual void drawGui(
const std::shared_ptr<RootContainer>& root) = 0;
184 TGUI_DEPRECATED(
"Use drawVertexArray instead") virtual
void drawTriangles(const
RenderStates& states, const
Vertex* vertices, std::
size_t vertexCount, const
int* indices =
nullptr, std::
size_t indexCount = 0);
196 void drawTriangles(const
RenderStates& states, std::initializer_list<
Vertex> vertices, std::initializer_list<
int> indices = {});
236 virtual void drawVertexArray(
const RenderStates& states,
const Vertex* vertices, std::size_t vertexCount,
237 const int* indices, std::size_t indexCount,
const std::shared_ptr<BackendTexture>& texture) = 0;
240 const int* indices, std::size_t indexCount,
const std::shared_ptr<BackendTexture>& texture);
268 std::vector<std::pair<FloatRect, FloatRect>> m_clipLayers;
271#ifndef TGUI_REMOVE_DEPRECATED_CODE
272 using BackendRenderTargetBase TGUI_DEPRECATED(
"BackendRenderTargetBase was renamed to BackendRenderTarget") = BackendRenderTarget;
Base class for render targets.
Definition: BackendRenderTarget.hpp:48
virtual void removeClippingLayer()
Removes the last added clipping region.
virtual void setView(FloatRect view, FloatRect viewport, Vector2f targetSize)
Informs the render target about which part of the window is used for rendering.
virtual ~BackendRenderTarget()=default
Virtual destructor.
virtual void drawText(const RenderStates &states, const Text &text)
Draws some text.
virtual void drawFilledRect(const RenderStates &states, Vector2f size, Color color)
Draws a colored rectangle.
virtual void drawSprite(const RenderStates &states, const Sprite &sprite)
Draws a texture.
virtual void clearScreen()
Clears the screen, called at the beginning of each frame when gui.mainLoop() is called.
Definition: BackendRenderTarget.hpp:73
virtual void drawWidget(const RenderStates &states, const std::shared_ptr< Widget > &widget)
Draws a widget, if the widget is visible.
virtual void drawVertexArray(const RenderStates &states, const Vertex *vertices, std::size_t vertexCount, const int *indices, std::size_t indexCount, const std::shared_ptr< BackendTexture > &texture)
Draws a vertex array. This is called by the other draw functions when they are not overriden.
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.
virtual void updateClipping(FloatRect clipRect, FloatRect clipViewport)
Called from addClippingLayer and removeClippingLayer to apply the clipping.
Definition: BackendRenderTarget.hpp:257
virtual void drawGui(const std::shared_ptr< RootContainer > &root)=0
Draws the gui and all of its widgets.
virtual void addClippingLayer(const RenderStates &states, FloatRect rect)
Adds another clipping region.
virtual void setClearColor(const tgui::Color &color)
Select the color that will be used by clearScreen.
Definition: BackendRenderTarget.hpp:64
virtual void drawBorders(const RenderStates &states, const Borders &borders, Vector2f size, Color color)
Draws borders inside a provided rectangle.
virtual void drawCircle(const RenderStates &states, float size, const Color &backgroundColor, float borderThickness=0, const Color &borderColor={})
Draws a circle.
Wrapper for colors.
Definition: Color.hpp:63
static const Color Black
Black predefined color.
Definition: Color.hpp:253
Definition: Outline.hpp:39
Definition: Sprite.hpp:45
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:36
States used for drawing.
Definition: RenderStates.hpp:39
Definition: Vertex.hpp:37