Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes

OpenTissue::gl::Renderbuffer Class Reference

#include <gl_render_buffer.h>

List of all members.

Public Member Functions

 Renderbuffer ()
 Renderbuffer (GLenum internal_format, int width, int height)
 ~Renderbuffer ()
void bind ()
void unbind ()
void set (GLenum internal_format, int width, int height)
GLuint get_id () const

Static Public Member Functions

static GLint get_max_size ()

Static Protected Member Functions

static GLuint create_buffer_id ()

Protected Attributes

GLuint m_buffer_id
 The render buffer identifier of this render buffer.

Detailed Description

Render Buffer. This class encapsulates the render buffer OpenGL object described in the frame buffer object (FBO) OpenGL spec. See the official spec at: http://oss.sgi.com/projects/ogl-sample/registry/EXT/framebuffer_object.txt for complete details.

A "render buffer" is a chunk of GPU memory used by frame buffer objects to represent "traditional" framebuffer memory (depth, stencil, and color buffers). By "traditional," we mean that the memory cannot be bound as a texture. With respect to GPU shaders, Render buffer memory is "write-only." Framebuffer operations such as alpha blending, depth test, alpha test, stencil test, etc. read from this memory in post-fragement-shader (ROP) operations.

The most common use of render buffers is to create depth and stencil buffers. Note that as of 7/1/05, NVIDIA drivers to do not support stencil Renderbuffers.

Usage Notes: 1) "internal_format" can be any of the following: Valid OpenGL internal formats beginning with: RGB, RGBA, DEPTH_COMPONENT

or a stencil buffer format (not currently supported in NVIDIA drivers as of 7/1/05). STENCIL_INDEX1_EXT STENCIL_INDEX4_EXT STENCIL_INDEX8_EXT STENCIL_INDEX16_EXT

This implementation was inspired by the ideas in the FBO class from GPUGP by Aaron Lefohn.


Constructor & Destructor Documentation

OpenTissue::gl::Renderbuffer::Renderbuffer (  )  [inline]
OpenTissue::gl::Renderbuffer::Renderbuffer ( GLenum  internal_format,
int  width,
int  height 
) [inline]

Specialized Constructor.

Parameters:
internal_format The format of the render buffer: RGB, RGBA, DEPTH_COMPONENT etc..
width The number of pixels in a row.
height The number of rows in the buffer.
OpenTissue::gl::Renderbuffer::~Renderbuffer (  )  [inline]

Member Function Documentation

void OpenTissue::gl::Renderbuffer::bind (  )  [inline]
static GLuint OpenTissue::gl::Renderbuffer::create_buffer_id (  )  [inline, static, protected]

Create Unused Render Buffer identifier.

Returns:
The unused identifier.
GLuint OpenTissue::gl::Renderbuffer::get_id (  )  const [inline]

Get Identifier.

Returns:
The identifier of the render buffer.
static GLint OpenTissue::gl::Renderbuffer::get_max_size (  )  [inline, static]

Get Maximum Size.

Returns:
The maximum size of a render buffer. I.e. the maximum number of ``pixels'' in widht and height arguments.
void OpenTissue::gl::Renderbuffer::set ( GLenum  internal_format,
int  width,
int  height 
) [inline]

Set Render Buffer Format and Size.

Parameters:
internal_format The format of the render buffer: RGB, RGBA, DEPTH_COMPONENT etc..
width The number of pixels in a row.
height The number of rows in the buffer.
void OpenTissue::gl::Renderbuffer::unbind (  )  [inline]

Member Data Documentation

The render buffer identifier of this render buffer.


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