25#ifndef TGUI_CANVAS_RAYLIB_HPP
26#define TGUI_CANVAS_RAYLIB_HPP
28#include <TGUI/Backend/Renderer/Raylib/BackendTextureRaylib.hpp>
30#if !TGUI_BUILD_AS_CXX_MODULE
31 #include <TGUI/Backend/Renderer/BackendRenderTarget.hpp>
32 #include <TGUI/Widgets/CanvasBase.hpp>
39TGUI_MODULE_EXPORT
namespace tgui
67 class TGUI_API CanvasRaylib :
public CanvasBase
71 using Ptr = std::shared_ptr<CanvasRaylib>;
72 using ConstPtr = std::shared_ptr<const CanvasRaylib>;
88 CanvasRaylib(
const char* typeName =
StaticWidgetType,
bool initRenderer =
true);
103 CanvasRaylib& operator= (
const CanvasRaylib& right);
108 CanvasRaylib& operator= (CanvasRaylib&& right) =
default;
153 return m_textureTarget;
167 RenderTexture2D m_textureTarget;
168 Vector2u m_textureSize;
169 Vector2u m_usedTextureSize;
170 std::shared_ptr<BackendTextureRaylib> m_backendTexture;
Base class for render targets.
Definition BackendRenderTarget.hpp:46
std::shared_ptr< CanvasRaylib > Ptr
Shared widget pointer.
Definition CanvasRaylib.hpp:71
static CanvasRaylib::Ptr create(const Layout2d &size={"100%", "100%"})
Creates a new canvas widget.
static CanvasRaylib::Ptr copy(const CanvasRaylib::ConstPtr &canvas)
Makes a copy of another canvas.
Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
std::shared_ptr< const CanvasRaylib > ConstPtr
Shared constant widget pointer.
Definition CanvasRaylib.hpp:72
CanvasRaylib(const CanvasRaylib ©)
Copy constructor.
void setSize(const Layout2d &size) override
Changes the size of the widget.
static constexpr const char StaticWidgetType[]
Type name of the widget.
Definition CanvasRaylib.hpp:74
RenderTexture2D & getTextureTarget()
Access the internal render texture to which you can render.
Definition CanvasRaylib.hpp:151
CanvasRaylib(CanvasRaylib &©)=default
Default move constructor.
void draw(BackendRenderTarget &target, RenderStates states) const override
Draw the widget to a render target.
~CanvasRaylib() override
Destructor.
Class to store the position or size of a widget.
Definition Layout.hpp:323
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:38
States used for drawing.
Definition RenderStates.hpp:38