GLS
1.0.0
GL Stuff - A library aimed at reducing the boilerplate OpenGL code you always have to write.
|
Class encapsulating an OpenGL renderbuffer object. More...
#include <renderbuffer.hpp>
Public Member Functions | |
renderbuffer (GLenum internal_format, GLsizei the_width, GLsizei the_height) | |
Construct a gls::renderbuffer without multi-sampling. More... | |
renderbuffer (GLsizei samples, GLenum internal_format, GLsizei the_width, GLsizei the_height) | |
Construct a gls::renderbuffer with multi-sampling. More... | |
GLuint | name () const |
Retrieve the OpenGL name of this renderbuffer. More... | |
GLsizei | width () const |
Retrieve the width of the allocated renderbuffer storage. More... | |
GLsizei | height () const |
Retrieve the height of the allocated renderbuffer storage. More... | |
void | bind () |
Bind this renderbuffer. More... | |
Static Public Member Functions | |
static void | unbind () |
Unbind the currently bound renderbuffer. More... | |
Class encapsulating an OpenGL renderbuffer object.
A gls::renderbuffer is an object that encapsulates an OpenGL renderbuffer object.
Like all objects in GLS, the underlying name is generated at object construction and deleted at destruction. This can be retrieved with name(). Additionally, the storage for the renderbuffer is automatically allocated at construction as well.
gls::renderbuffer objects are only used as part of gls::framebuffer objects. If you want, you can also manually attach the gls::renderbuffer object to your own framebuffer object using name().
To bind a gls::renderbuffer, simply call bind(). It will bind the gls::renderbuffer to the GL_RENDERBUFFER binding point and replace any previously bound to that target. To clear the binding to that target, call unbind().
Example usage:
renderbuffer | ( | GLenum | internal_format, |
GLsizei | the_width, | ||
GLsizei | the_height | ||
) |
Construct a gls::renderbuffer without multi-sampling.
Renderbuffer storage is automatically allocated.
internal_format | Internal format of the renderbuffer storage |
the_width | Width of the renderbuffer storage |
the_height | Height of the renderbuffer storage |
renderbuffer | ( | GLsizei | samples, |
GLenum | internal_format, | ||
GLsizei | the_width, | ||
GLsizei | the_height | ||
) |
Construct a gls::renderbuffer with multi-sampling.
Renderbuffer storage is automatically allocated.
samples | Number of samples to use for the renderbuffer storage |
internal_format | Internal format of the renderbuffer storage |
the_width | Width of the renderbuffer storage |
the_height | Height of the renderbuffer storage |
GLuint name | ( | ) | const |
Retrieve the OpenGL name of this renderbuffer.
GLsizei width | ( | ) | const |
Retrieve the width of the allocated renderbuffer storage.
GLsizei height | ( | ) | const |
Retrieve the height of the allocated renderbuffer storage.
void bind | ( | ) |
Bind this renderbuffer.
|
static |
Unbind the currently bound renderbuffer.