1#ifndef RAYLIB_CPP_INCLUDE_RENDERTEXTURE_HPP_
2#define RAYLIB_CPP_INCLUDE_RENDERTEXTURE_HPP_
5#include "./raylib-cpp-utils.hpp"
6#include "./RaylibException.hpp"
7#include "./TextureUnmanaged.hpp"
26 RenderTexture(
unsigned int id, const ::Texture& texture, const ::Texture& depth) :
33 set(::LoadRenderTexture(width, height));
46 GETTER(
unsigned int, Id,
id)
55 void SetTexture(const ::Texture& newTexture) {
66 void SetDepth(const ::Texture& newDepth) {
97 UnloadRenderTexture(*
this);
104 ::BeginTextureMode(*
this);
120 return ::LoadRenderTexture(width, height);
127 return ::IsRenderTextureReady(*
this);
131 void set(const ::RenderTexture& renderTexture) {
132 id = renderTexture.id;
133 texture = renderTexture.texture;
134 depth = renderTexture.depth;
138using RenderTexture2D = RenderTexture;
RenderTexture type, for texture rendering.
TextureUnmanaged GetTexture()
Get the color buffer attachment texture.
bool IsReady() const
Retrieves whether or not the render texture is ready.
RenderTexture & BeginMode()
Initializes render texture for drawing.
RenderTexture & EndMode()
Ends drawing to render texture.
TextureUnmanaged GetDepth()
Depth buffer attachment texture.
RenderTexture()
Default constructor to build an empty RenderTexture.
static RenderTexture Load(int width, int height)
Load texture for rendering (framebuffer)
RenderTexture(int width, int height)
Load texture for rendering (framebuffer)
A Texture that is not managed by C++ RAII.