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

#include <fbo.hpp>

Inherits zmol::noncopyable_::noncopyable.

List of all members.

Public Member Functions

 renderbuffer (GLenum const p_format, GLsizei const p_width, GLsizei const p_height, GLsizei const p_num_antialiasing_samples)
 ~renderbuffer ()
GLuint get_name () const
void bind ()
void unbind ()

Detailed Description

Renderbuffer wrapper class.

The class creates a renderbuffer 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::renderbuffer::renderbuffer ( GLenum const  p_format,
GLsizei const  p_width,
GLsizei const  p_height,
GLsizei const  p_num_antialiasing_samples 
)
explicit

Constructor. Creates the renderbuffer using glGenRenderbuffers().

Parameters:
p_formatPixel format of the renderbuffer.
p_widthWidth of the renderbuffer, in pixels.
p_heightHeight of the renderbuffer, in pixels.
p_num_antialiasing_samplesNumber of antialiasing samples. Set this to 0 to disable antialiasing in this renderbuffer.
zmol::renderbuffer::~renderbuffer ( )

Destructor. Destroys the renderbuffer using glDeleteRenderbuffers().


Member Function Documentation

void zmol::renderbuffer::bind ( )

Binds the renderbuffer to the OpenGL context.

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

Returns the target of the renderbuffer.

void zmol::renderbuffer::unbind ( )

Unbinds the renderbuffer to the OpenGL context.