25#ifndef TGUI_BACKEND_RENDER_TARGET_HPP
26#define TGUI_BACKEND_RENDER_TARGET_HPP
28#include <TGUI/Rect.hpp>
29#include <TGUI/Color.hpp>
30#include <TGUI/Sprite.hpp>
31#include <TGUI/Text.hpp>
32#include <TGUI/Outline.hpp>
33#include <TGUI/RenderStates.hpp>
37TGUI_MODULE_EXPORT
namespace tgui
90 virtual void drawGui(
const std::shared_ptr<RootContainer>& root) = 0;
218 const Borders& borders = {0},
const Color& borderColor = Color::Black);
231 const unsigned int* indices, std::size_t indexCount,
const std::shared_ptr<BackendTexture>& texture) = 0;
267 std::vector<std::pair<FloatRect, FloatRect>> m_clipLayers;
Base class for render targets.
Definition BackendRenderTarget.hpp:46
virtual void updateClipping(FloatRect clipRect, FloatRect clipViewport)=0
Called from addClippingLayer and removeClippingLayer to apply the clipping.
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 setClearColor(const Color &color)=0
Select the color that will be used by clearScreen.
virtual void drawTextWithoutOutline(const RenderStates &states, const Text &text)
Draws some text, but without rendering its outline.
virtual void drawFilledRect(const RenderStates &states, Vector2f size, Color color)
Draws a colored rectangle.
virtual void drawTriangle(const RenderStates &states, const Vertex &point1, const Vertex &point2, const Vertex &point3)
Draws a single triangles (using the color that is specified in the vertices)
virtual void drawSprite(const RenderStates &states, const Sprite &sprite)
Draws a texture.
virtual void drawTextOutline(const RenderStates &states, const Text &text)
Draws only the outline of some text.
virtual void drawVertexArray(const RenderStates &states, const Vertex *vertices, std::size_t vertexCount, const unsigned int *indices, std::size_t indexCount, const std::shared_ptr< BackendTexture > &texture)=0
Draws a vertex array. This is called by the other draw functions when they are not overriden.
Vector2f getPixelsPerPoint() const
Returns the current mapping between the screen pixels and the points in the current view.
virtual void drawWidget(const RenderStates &states, const std::shared_ptr< Widget > &widget)
Draws a widget, if the widget is visible.
virtual void clearScreen()=0
Clears the screen, called at the beginning of each frame when gui.mainLoop() is called.
BackendRenderTarget()=default
Default constructor.
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 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 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:73
Definition Outline.hpp:38
Backend-independent wrapper around the backend-specific text class.
Definition Text.hpp:48
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:38
States used for drawing.
Definition RenderStates.hpp:38