25#ifndef TGUI_CANVAS_GLES2_HPP
26#define TGUI_CANVAS_GLES2_HPP
28#include <TGUI/Backend/Renderer/GLES2/BackendTextureGLES2.hpp>
30#if !TGUI_BUILD_AS_CXX_MODULE
31 #include <TGUI/Backend/Renderer/BackendRenderTarget.hpp>
32 #include <TGUI/Widgets/CanvasBase.hpp>
37TGUI_MODULE_EXPORT
namespace tgui
67 using Ptr = std::shared_ptr<CanvasGLES2>;
68 using ConstPtr = std::shared_ptr<const CanvasGLES2>;
70 static constexpr const char StaticWidgetType[] =
"CanvasGLES2";
79 CanvasGLES2(
const char* typeName = StaticWidgetType,
bool initRenderer =
true);
130 using Widget::setSize;
160 unsigned int m_textureId = 0;
161 unsigned int m_frameBuffer = 0;
164 std::shared_ptr<BackendTextureGLES2> m_backendTexture = std::make_shared<BackendTextureGLES2>();
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
CanvasGLES2 provides a way to directly render OpenGL ES contents on a widget.
Definition CanvasGLES2.hpp:64
Widget::Ptr clone() const override
Makes a copy of the widget if you don't know its exact type.
std::shared_ptr< const CanvasGLES2 > ConstPtr
Shared constant widget pointer.
Definition CanvasGLES2.hpp:68
static CanvasGLES2::Ptr create(const Layout2d &size={"100%", "100%"})
Creates a new canvas widget.
CanvasGLES2(const CanvasGLES2 ©)
Copy constructor.
void draw(BackendRenderTarget &target, RenderStates states) const override
Draw the widget to a render target.
void setSize(const Layout2d &size) override
Changes the size of the widget.
static CanvasGLES2::Ptr copy(const CanvasGLES2::ConstPtr &canvas)
Makes a copy of another canvas.
std::shared_ptr< CanvasGLES2 > Ptr
Shared widget pointer.
Definition CanvasGLES2.hpp:67
unsigned int bindFramebuffer() const
Binds the framebuffer of the canvas.
CanvasGLES2(CanvasGLES2 &©)=default
Default move constructor.
~CanvasGLES2() 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