cgv
|
provides a class that manages a frame buffer along with its attachments More...
#include <managed_frame_buffer.h>
Classes | |
struct | attachment |
Public Member Functions | |
void | destruct (const context &ctx) |
ivec2 | get_size () |
void | set_size (const ivec2 &size) |
Set the size of the framebuffer attachments. | |
void | add_attachment (const std::string &name, const std::string &format="uint8[R,G,B]", TextureFilter tf=TF_NEAREST, TextureWrap tw=TW_CLAMP_TO_EDGE, bool attach=true) |
bool | enable_attachment (context &ctx, const std::string &name, int tex_unit=-1) |
bool | disable_attachment (context &ctx, const std::string &name) |
texture * | attachment_texture_ptr (const std::string &name) |
bool | ensure (context &ctx) |
Ensure the framebuffer is constructed with the specified size. | |
bool | enable (context &ctx, bool push_viewport=true) |
bool | disable (context &ctx, bool pop_viewport=true) |
frame_buffer & | ref_frame_buffer () |
Protected Attributes | |
frame_buffer | fb |
unsigned | index_counter = 0 |
std::unordered_map< std::string, attachment > | attachments |
ivec2 | size |
provides a class that manages a frame buffer along with its attachments
Definition at line 13 of file managed_frame_buffer.h.
cgv::render::managed_frame_buffer::managed_frame_buffer | ( | ) |
Definition at line 6 of file managed_frame_buffer.cxx.
void cgv::render::managed_frame_buffer::add_attachment | ( | const std::string & | name, |
const std::string & | format = "uint8[R,G,B]" , |
||
TextureFilter | tf = TF_NEAREST , |
||
TextureWrap | tw = TW_CLAMP_TO_EDGE , |
||
bool | attach = true |
||
) |
Definition at line 33 of file managed_frame_buffer.cxx.
texture * cgv::render::managed_frame_buffer::attachment_texture_ptr | ( | const std::string & | name | ) |
Definition at line 73 of file managed_frame_buffer.cxx.
void cgv::render::managed_frame_buffer::destruct | ( | const context & | ctx | ) |
Definition at line 12 of file managed_frame_buffer.cxx.
bool cgv::render::managed_frame_buffer::disable | ( | context & | ctx, |
bool | pop_viewport = true |
||
) |
Definition at line 110 of file managed_frame_buffer.cxx.
bool cgv::render::managed_frame_buffer::disable_attachment | ( | context & | ctx, |
const std::string & | name | ||
) |
Definition at line 62 of file managed_frame_buffer.cxx.
bool cgv::render::managed_frame_buffer::enable | ( | context & | ctx, |
bool | push_viewport = true |
||
) |
Definition at line 103 of file managed_frame_buffer.cxx.
bool cgv::render::managed_frame_buffer::enable_attachment | ( | context & | ctx, |
const std::string & | name, | ||
int | tex_unit = -1 |
||
) |
Definition at line 51 of file managed_frame_buffer.cxx.
bool cgv::render::managed_frame_buffer::ensure | ( | context & | ctx | ) |
Ensure the framebuffer is constructed with the specified size.
ctx | The graphics context. |
Definition at line 84 of file managed_frame_buffer.cxx.
References cgv::render::frame_buffer::get_height(), cgv::render::frame_buffer::get_width(), cgv::render::render_component::is_created(), cgv::math::fvec< T, N >::x(), and cgv::math::fvec< T, N >::y().
Referenced by cgv::app::navigator::init(), cgv::app::canvas_overlay::init(), and cgv::app::navigator::init_frame().
ivec2 cgv::render::managed_frame_buffer::get_size | ( | ) |
Definition at line 23 of file managed_frame_buffer.cxx.
|
inline |
Definition at line 75 of file managed_frame_buffer.h.
void cgv::render::managed_frame_buffer::set_size | ( | const ivec2 & | size | ) |
Set the size of the framebuffer attachments.
Requires to call ensure afterwards to actually construct the framebuffer.
If the given width or height is <= 0, the attachment widths or heights will be set to the context width or height respectively.
size | The requested size. |
Definition at line 28 of file managed_frame_buffer.cxx.
Referenced by cgv::app::navigator::init(), cgv::app::canvas_overlay::init(), and cgv::app::navigator::init_frame().
|
protected |
Definition at line 40 of file managed_frame_buffer.h.
|
protected |
Definition at line 38 of file managed_frame_buffer.h.
|
protected |
Definition at line 39 of file managed_frame_buffer.h.
|
protected |
Definition at line 41 of file managed_frame_buffer.h.