1#ifndef RAYLIB_CPP_INCLUDE_RENDERTEXTURE_HPP_
2#define RAYLIB_CPP_INCLUDE_RENDERTEXTURE_HPP_
4#include "./TextureUnmanaged.hpp"
5#include "./raylib-cpp-utils.hpp"
23 RenderTexture(
unsigned int id, const ::Texture& texture, const ::Texture& depth)
45 GETTER(
unsigned int, Id,
id)
52 void SetTexture(const ::Texture& newTexture) { texture = newTexture; }
59 void SetDepth(const ::Texture& newDepth) { depth = newDepth; }
83 ~RenderTexture() { Unload(); }
85 void Unload() { UnloadRenderTexture(*
this); }
91 ::BeginTextureMode(*
this);
111 [[nodiscard]]
bool IsValid()
const { return ::IsRenderTextureValid(*
this); }
113 void set(const ::RenderTexture& renderTexture) {
114 id = renderTexture.id;
115 texture = renderTexture.texture;
116 depth = renderTexture.depth;
120using RenderTexture2D = RenderTexture;
RenderTexture type, for texture rendering.
TextureUnmanaged GetTexture()
Get the color buffer attachment texture.
RenderTexture & BeginMode()
Initializes render texture for drawing.
RenderTexture & EndMode()
Ends drawing to render texture.
bool IsValid() const
Retrieves whether or not the render texture is ready.
TextureUnmanaged GetDepth()
Depth buffer attachment texture.
static RenderTexture Load(int width, int height)
Load texture for rendering (framebuffer)
RenderTexture()=default
Default constructor to build an empty RenderTexture.
RenderTexture(int width, int height)
Load texture for rendering (framebuffer)
A Texture that is not managed by C++ RAII.
All raylib-cpp classes and functions appear in the raylib namespace.