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
71 using Ptr = std::shared_ptr<CanvasRaylib>;
72 using ConstPtr = std::shared_ptr<const CanvasRaylib>;
74 static constexpr const char StaticWidgetType[] =
"CanvasRaylib";
88 CanvasRaylib(
const char* typeName = StaticWidgetType,
bool initRenderer =
true);
134 using Widget::setSize;
153 return m_textureTarget;
167 RenderTexture2D m_textureTarget;
170 std::shared_ptr<BackendTextureRaylib> m_backendTexture;
Base class for render targets.
Definition BackendRenderTarget.hpp:46
This class is used as base class for the backend-specific canvas widgets.
Definition CanvasBase.hpp:38
CanvasRaylib provides a way to directly render raylib contents on a widget.
Definition CanvasRaylib.hpp:68
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.
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