cgv
Loading...
Searching...
No Matches
cgv::render::managed_frame_buffer Class Reference

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 ()
 
bool set_size (const ivec2 &size)
 Sets the size of the framebuffer renderbuffers.
 
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)
 
textureattachment_texture_ptr (const std::string &name)
 
bool ensure (context &ctx)
 
bool enable (context &ctx)
 
bool disable (context &ctx)
 
frame_bufferref_frame_buffer ()
 

Protected Attributes

frame_buffer fb
 
unsigned index_counter = 0
 
std::unordered_map< std::string, attachmentattachments
 
ivec2 size
 

Detailed Description

provides a class that manages a frame buffer along with its attachments

Definition at line 13 of file managed_frame_buffer.h.

Constructor & Destructor Documentation

◆ managed_frame_buffer()

cgv::render::managed_frame_buffer::managed_frame_buffer ( )

Definition at line 6 of file managed_frame_buffer.cxx.

◆ ~managed_frame_buffer()

cgv::render::managed_frame_buffer::~managed_frame_buffer ( )

Definition at line 12 of file managed_frame_buffer.cxx.

Member Function Documentation

◆ add_attachment()

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 52 of file managed_frame_buffer.cxx.

◆ attachment_texture_ptr()

texture * cgv::render::managed_frame_buffer::attachment_texture_ptr ( const std::string &  name)

Definition at line 92 of file managed_frame_buffer.cxx.

◆ destruct()

void cgv::render::managed_frame_buffer::destruct ( const context ctx)

Definition at line 17 of file managed_frame_buffer.cxx.

◆ disable()

bool cgv::render::managed_frame_buffer::disable ( context ctx)

Definition at line 126 of file managed_frame_buffer.cxx.

◆ disable_attachment()

bool cgv::render::managed_frame_buffer::disable_attachment ( context ctx,
const std::string &  name 
)

Definition at line 81 of file managed_frame_buffer.cxx.

◆ enable()

bool cgv::render::managed_frame_buffer::enable ( context ctx)

Definition at line 119 of file managed_frame_buffer.cxx.

◆ enable_attachment()

bool cgv::render::managed_frame_buffer::enable_attachment ( context ctx,
const std::string &  name,
int  tex_unit = -1 
)

Definition at line 70 of file managed_frame_buffer.cxx.

◆ ensure()

bool cgv::render::managed_frame_buffer::ensure ( context ctx)

Definition at line 103 of file managed_frame_buffer.cxx.

◆ get_size()

ivec2 cgv::render::managed_frame_buffer::get_size ( )

Definition at line 28 of file managed_frame_buffer.cxx.

◆ ref_frame_buffer()

frame_buffer & cgv::render::managed_frame_buffer::ref_frame_buffer ( )
inline

Definition at line 73 of file managed_frame_buffer.h.

◆ set_size()

bool cgv::render::managed_frame_buffer::set_size ( const ivec2 size)

Sets the size of the framebuffer renderbuffers.

Set the x and/or y-component to <= 0 to use the width/height from the context. Returns false if the size is larger than the maximum allowed render buffer size, as given by the OpenGL API.

Definition at line 33 of file managed_frame_buffer.cxx.

Referenced by cgv::app::navigator::init(), cgv::app::canvas_overlay::init(), and cgv::app::navigator::init_frame().

Member Data Documentation

◆ attachments

std::unordered_map<std::string, attachment> cgv::render::managed_frame_buffer::attachments
protected

Definition at line 40 of file managed_frame_buffer.h.

◆ fb

frame_buffer cgv::render::managed_frame_buffer::fb
protected

Definition at line 38 of file managed_frame_buffer.h.

◆ index_counter

unsigned cgv::render::managed_frame_buffer::index_counter = 0
protected

Definition at line 39 of file managed_frame_buffer.h.

◆ size

ivec2 cgv::render::managed_frame_buffer::size
protected

Definition at line 41 of file managed_frame_buffer.h.


The documentation for this class was generated from the following files: