25#ifndef TGUI_CANVAS_SDL_GPU_HPP
26#define TGUI_CANVAS_SDL_GPU_HPP
28#include <TGUI/Backend/Renderer/SDL_GPU/BackendTextureSDLGPU.hpp>
29#include <TGUI/Backend/Renderer/BackendRenderTarget.hpp>
30#include <TGUI/Widgets/CanvasBase.hpp>
32#include <TGUI/extlibs/IncludeSDL.hpp>
60 class TGUI_API CanvasSDLGPU :
public CanvasBase
64 using Ptr = std::shared_ptr<CanvasSDLGPU>;
65 using ConstPtr = std::shared_ptr<const CanvasSDLGPU>;
76 CanvasSDLGPU(
const char* typeName =
StaticWidgetType,
bool initRenderer =
true);
91 CanvasSDLGPU& operator= (
const CanvasSDLGPU& right);
96 CanvasSDLGPU& operator= (CanvasSDLGPU&& right) =
default;
143 return m_backendTexture->getInternalTexture();
157 Vector2u m_textureSize;
158 std::shared_ptr<BackendTextureSDLGPU> m_backendTexture;
Base class for render targets.
Definition BackendRenderTarget.hpp:46
SDL_GPUTexture * getTexture()
Access the internal texture on which you can render.
Definition CanvasSDLGPU.hpp:141
void setSize(const Layout2d &size) override
Changes the size of the widget.
static CanvasSDLGPU::Ptr create(const Layout2d &size={"100%", "100%"})
Creates a new canvas widget.
std::shared_ptr< CanvasSDLGPU > Ptr
Shared widget pointer.
Definition CanvasSDLGPU.hpp:64
static CanvasSDLGPU::Ptr copy(const CanvasSDLGPU::ConstPtr &canvas)
Makes a copy of another canvas.
CanvasSDLGPU(const CanvasSDLGPU ©)
Copy constructor.
void draw(BackendRenderTarget &target, RenderStates states) const override
Draw the widget to a render target.
std::shared_ptr< const CanvasSDLGPU > ConstPtr
Shared constant widget pointer.
Definition CanvasSDLGPU.hpp:65
static constexpr const char StaticWidgetType[]
Type name of the widget.
Definition CanvasSDLGPU.hpp:67
CanvasSDLGPU(CanvasSDLGPU &©)=default
Default move constructor.
Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
Class to store the position or size of a widget.
Definition Layout.hpp:321
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:36
States used for drawing.
Definition RenderStates.hpp:38