15 #ifndef FPLBASE_RENDER_TARGET_H
16 #define FPLBASE_RENDER_TARGET_H
18 #include "fplbase/config.h"
20 #include "mathfu/glsl_mappings.h"
32 enum RenderTargetFormat {
33 kRenderTargetFormatUByte,
34 kRenderTargetFormatCount,
54 void Initialize(
const mathfu::vec2i& dimensions);
60 void Initialize(
const mathfu::vec2i& dimensions, RenderTargetFormat format,
90 inline bool IsTexture()
const {
return ValidBufferHandle(framebuffer_id_); }
101 return rendered_texture_id_;
121 mathfu::vec2i dimensions_;
131 #endif // FPLBASE_RENDER_TARGET_H
bool IsTexture() const
Checks if this rendertarget refer to an off-screen texture.
Definition: render_target.h:90
void Initialize(const mathfu::vec2i &dimensions)
Initialize a render target of the provided dimensions.
void Delete()
Deletes the associated opengl resources associated with the RenderTarget.
void BindAsTexture(int texture_number) const
Binds the texture associated with this rendertarget as the active texture.
bool initialized() const
Checks if the RenderTarget has been initialized.
Definition: render_target.h:112
static RenderTarget ScreenRenderTarget(Renderer &renderer)
Gets the RenderTarget that corresponds to the screen.
TextureHandle GetTextureId() const
Gets the TextureId associated with the RenderTarget, assuming that it is texture-based.
Definition: render_target.h:99
void SetAsRenderTarget() const
Sets the RenderTarget as the active render target.
Abstracts a surface that can be rendered to.
Definition: render_target.h:46
Renderer is the main API class for rendering commands.
Definition: renderer.h:310