Draw to an opengl texture instead of the screen.
Framebuffer m_framebuffer
OpenGL framebuffer abstraction.
RenderTexture(const RenderTexture &)=delete
Copy constructor.
const glm::mat4 & get_proj()
Get render texture projection.
void create(const int width, const int height)
Create framebuffer and texture.
void save(std::string_view file)
Saves texture to file on disk.
unsigned int texture() const
Gets framebuffer texture.
RenderTexture & operator=(RenderTexture &&)
Move assignment operator.
RenderTexture & operator=(const RenderTexture &)=delete
Copy assignment operator.
void recreate(const int width=-1, const int height=-1)
Destroy and re-create framebuffer.
void clear()
Clear framebuffer attachments.
void bind(bool clear=true)
Activate context.