jubilant-funicular
Public Member Functions | Private Attributes | List of all members
nta::FrameBuffer Class Reference

A wrapper around an OpenGL Framebuffer object. More...

#include <FrameBuffer.h>

Collaboration diagram for nta::FrameBuffer:
Collaboration graph
[legend]

Public Member Functions

void init ()
 Initializes a new FrameBuffer (deleting the old one if it existed)
 
void use () const
 Binds this FrameBuffer.
 
void set_texture (GLuint idx=0) const
 Sets which texture to draw to.
 
void unuse () const
 Binds the default FrameBuffer (i.e. the screen)
 
GLuint add_texture (GLuint width, GLuint height, GLint min_filt=GL_LINEAR, GLint mag_filt=GL_LINEAR, bool rgba=true)
 Returns index of added texture.
 
GLuint get_tex (GLuint idx=0) const
 Returns id of texture associated with GL_COLOR_ATTACHMENTidx.
 
GLuint get_width (GLuint idx=0) const
 Returns width of texture associated with GL_COLOR_ATTACHMENTidx.
 
GLuint get_height (GLuint idx=0) const
 Returns height of texture associated with GL_COLOR_ATTACHMENTidx.
 
GLuint num_texs () const
 
void destroy ()
 Destroys this FrameBuffer.
 

Private Attributes

GLuint m_fbo
 The id of this frame buffer.
 
std::vector< GLuint > m_texs
 The textures to draw to.
 
std::vector< GLuint > m_rbos
 The render buffer objects (currently unused)
 

Detailed Description

A wrapper around an OpenGL Framebuffer object.

Definition at line 10 of file FrameBuffer.h.


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