nCine::GLRenderbuffer class

Wraps an OpenGL renderbuffer object.

Manages the lifetime of a single OpenGL renderbuffer object and allocates its storage on construction with the given internal format and dimensions. Binding to GL_RENDERBUFFER is cached so that redundant glBindRenderbuffer() calls are skipped. Typically attached to a GLFramebuffer.

Public static functions

static auto Unbind() -> bool
Unbinds any renderbuffer from GL_RENDERBUFFER.

Constructors, destructors, conversion operators

GLRenderbuffer(GLenum internalFormat, GLsizei width, GLsizei height)
~GLRenderbuffer()
GLRenderbuffer(const GLRenderbuffer&) deleted

Public functions

auto operator=(const GLRenderbuffer&) -> GLRenderbuffer& deleted
auto GetGLHandle() const -> GLuint
Returns the OpenGL handle of the renderbuffer object.
void SetAttachment(GLenum attachment)
Sets the framebuffer attachment point this renderbuffer is associated with.
auto GetAttachment() const -> GLenum
Returns the framebuffer attachment point this renderbuffer is associated with.
auto Bind() const -> bool
Binds the renderbuffer to GL_RENDERBUFFER.
void SetObjectLabel(StringView label)
Sets an OpenGL object label for the renderbuffer, for debugging.

Function documentation

static bool nCine::GLRenderbuffer::Unbind()

Unbinds any renderbuffer from GL_RENDERBUFFER.

Returns true if a glBindRenderbuffer() call was issued, false if nothing was bound

bool nCine::GLRenderbuffer::Bind() const

Binds the renderbuffer to GL_RENDERBUFFER.

Returns true if a glBindRenderbuffer() call was issued, false if it was already bound