26#ifndef TGUI_CANVAS_SDL_HPP
27#define TGUI_CANVAS_SDL_HPP
29#include <TGUI/Backend/Renderer/SDL_Renderer/BackendTextureSDL.hpp>
31#if !TGUI_BUILD_AS_CXX_MODULE
32 #include <TGUI/Backend/Renderer/BackendRenderTarget.hpp>
33 #include <TGUI/Widgets/CanvasBase.hpp>
36#include <TGUI/extlibs/IncludeSDL.hpp>
40TGUI_MODULE_EXPORT
namespace tgui
72 using Ptr = std::shared_ptr<CanvasSDL>;
73 using ConstPtr = std::shared_ptr<const CanvasSDL>;
75 static constexpr const char StaticWidgetType[] =
"CanvasSDL";
85 CanvasSDL(
const char* typeName = StaticWidgetType,
bool initRenderer =
true);
141 using Widget::setSize;
165 return m_textureTarget;
181 SDL_Texture* m_textureTarget =
nullptr;
184 std::shared_ptr<BackendTextureSDL> m_backendTexture;
Base class for render targets.
Definition BackendRenderTarget.hpp:48
This class is used as base class for the backend-specific canvas widgets.
Definition CanvasBase.hpp:39
Definition CanvasSDL.hpp:69
static TGUI_NODISCARD CanvasSDL::Ptr copy(const CanvasSDL::ConstPtr &canvas)
Makes a copy of another canvas.
void setSize(const Layout2d &size) override
Changes the size of the widget.
std::shared_ptr< const CanvasSDL > ConstPtr
Shared constant widget pointer.
Definition CanvasSDL.hpp:73
std::shared_ptr< CanvasSDL > Ptr
Shared widget pointer.
Definition CanvasSDL.hpp:72
void draw(BackendRenderTarget &target, RenderStates states) const override
Draw the widget to a render target.
TGUI_NODISCARD Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
CanvasSDL(CanvasSDL &©)=default
Default move constructor.
static TGUI_NODISCARD CanvasSDL::Ptr create(const Layout2d &size={"100%", "100%"})
Creates a new canvas widget.
CanvasSDL(const CanvasSDL ©)
Copy constructor.
TGUI_NODISCARD SDL_Texture * getTextureTarget()
Access the internal texture on which you can render.
Definition CanvasSDL.hpp:163
Class to store the position or size of a widget.
Definition Layout.hpp:305
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:39
States used for drawing.
Definition RenderStates.hpp:39