25 void init(
GfxDevice& device,
u32 width,
u32 height,
bool depth =
true,
bool linearFilter =
false,
bool floatColor =
false);
34 glm::uvec2
getSize()
const {
return { width_, height_ }; }
38 bool isValid()
const {
return framebuffer_ !=
nullptr; }
46 bool has_depth_ =
true;
47 bool linear_filter_ =
false;
61 Handle create(
u32 width,
u32 height,
bool depth =
true,
bool linearFilter =
false,
bool floatColor =
false);
69 std::vector<Unique<RenderTarget>> targets_;
70 std::vector<Handle> free_list_;
GPU framebuffer abstraction for render-to-texture.
Core type definitions and utilities for ESEngine.
Abstract graphics device interface.
void setDevice(GfxDevice &device)
Binds the device used to create render targets. Call once at setup.
Handle create(u32 width, u32 height, bool depth=true, bool linearFilter=false, bool floatColor=false)
static constexpr Handle INVALID_HANDLE
void release(Handle handle)
RenderTarget * get(Handle handle)
RenderTargetManager()=default
bool isValid(Handle handle) const
~RenderTargetManager()=default
RenderTarget(const RenderTarget &)=delete
TextureHandle getDepthTexture() const
TextureHandle getColorTexture() const
RenderTarget & operator=(RenderTarget &&)=default
RenderTarget & operator=(const RenderTarget &)=delete
void init(GfxDevice &device, u32 width, u32 height, bool depth=true, bool linearFilter=false, bool floatColor=false)
RenderTarget(RenderTarget &&)=default
void resize(u32 width, u32 height)
FramebufferHandle getFramebuffer() const
glm::uvec2 getSize() const
FramebufferHandle
Handle 0 is the default framebuffer (backbuffer); it cannot be created or deleted.
std::unique_ptr< T > Unique
Unique ownership smart pointer.
std::uint32_t u32
Unsigned 32-bit integer.