#include <gl_render_buffer.h>
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. |
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.
OpenTissue::gl::Renderbuffer::Renderbuffer | ( | ) | [inline] |
OpenTissue::gl::Renderbuffer::Renderbuffer | ( | GLenum | internal_format, | |
int | width, | |||
int | height | |||
) | [inline] |
Specialized Constructor.
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] |
void OpenTissue::gl::Renderbuffer::bind | ( | ) | [inline] |
static GLuint OpenTissue::gl::Renderbuffer::create_buffer_id | ( | ) | [inline, static, protected] |
Create Unused Render Buffer identifier.
GLuint OpenTissue::gl::Renderbuffer::get_id | ( | ) | const [inline] |
Get Identifier.
static GLint OpenTissue::gl::Renderbuffer::get_max_size | ( | ) | [inline, static] |
Get Maximum Size.
void OpenTissue::gl::Renderbuffer::set | ( | GLenum | internal_format, | |
int | width, | |||
int | height | |||
) | [inline] |
Set Render Buffer Format and Size.
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] |
GLuint OpenTissue::gl::Renderbuffer::m_buffer_id [protected] |
The render buffer identifier of this render buffer.