1 #ifndef NTA_FRAMEBUFFER_H_INCLUDED
2 #define NTA_FRAMEBUFFER_H_INCLUDED
33 GLint min_filt = GL_LINEAR, GLint mag_filt = GL_LINEAR,
36 GLuint
get_tex(GLuint idx = 0)
const;
41 GLuint num_texs()
const {
return m_texs.size(); }
48 #endif // NTA_FRAMEBUFFER_H_INCLUDED
void init()
Initializes a new FrameBuffer (deleting the old one if it existed)
std::vector< GLuint > m_rbos
The render buffer objects (currently unused)
GLuint get_tex(GLuint idx=0) const
Returns id of texture associated with GL_COLOR_ATTACHMENTidx.
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.
void set_texture(GLuint idx=0) const
Sets which texture to draw to.
GLuint get_width(GLuint idx=0) const
Returns width of texture associated with GL_COLOR_ATTACHMENTidx.
std::vector< GLuint > m_texs
The textures to draw to.
GLuint get_height(GLuint idx=0) const
Returns height of texture associated with GL_COLOR_ATTACHMENTidx.
void unuse() const
Binds the default FrameBuffer (i.e. the screen)
A wrapper around an OpenGL Framebuffer object.
GLuint m_fbo
The id of this frame buffer.
void use() const
Binds this FrameBuffer.
void destroy()
Destroys this FrameBuffer.