zMol
A viewer for molecular data using OpenGL and ambient occlusion
Public Member Functions
zmol::fbo Class Reference

#include <fbo.hpp>

Inherits zmol::noncopyable_::noncopyable.

List of all members.

Public Member Functions

 fbo (GLenum const p_target=GL_FRAMEBUFFER)
 ~fbo ()
GLuint get_name () const
GLuint get_target () const
void bind ()
void unbind ()

Detailed Description

Framebuffer object wrapper class.

The class creates a framebuffer object in the constructor, and destroys it in the destructor. This makes proper use of the C++ RAII idiom, and ensures exception safety (-> no resource leak).


Constructor & Destructor Documentation

zmol::fbo::fbo ( GLenum const  p_target = GL_FRAMEBUFFER)
explicit

Constructor. Creates the framebuffer object using glGenFramebuffers().

Parameters:
p_targetTarget. Can be GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER or GL_FRAMEBUFFER (the default).
zmol::fbo::~fbo ( )

Destructor. Destroys the framebuffer object using glDeleteFramebuffers().


Member Function Documentation

void zmol::fbo::bind ( )

Binds the framebuffer object to the OpenGL context.

GLuint zmol::fbo::get_name ( ) const
inline

Returns the OpenGL name of the framebuffer object.

GLuint zmol::fbo::get_target ( ) const
inline

Returns the target of the framebuffer object.

void zmol::fbo::unbind ( )

Unbinds the framebuffer object to the OpenGL context.