class
RenderbufferRenderbuffer.
Contents
Attachable to framebuffer as render target, see Framebuffer documentation for more information.
Performance optimizations
The engine tracks currently bound renderbuffer to avoid unnecessary calls to glBindRenderbuffer() in setStorage(). Renderbuffer limits and implementation-defined values (such as maxSize()) are cached, so repeated queries don't result in repeated glGet() calls.
If either ARB_
Base classes
- class AbstractObject
- Base for all OpenGL objects.
Public static functions
- static auto maxSize() -> Int
- Max supported renderbuffer size.
- static auto maxSamples() -> Int
- Max supported sample count.
- static auto wrap(GLuint id, ObjectFlags flags = {}) -> Renderbuffer
- Wrap existing OpenGL renderbuffer object.
Constructors, destructors, conversion operators
- Renderbuffer() explicit
- Constructor.
- Renderbuffer(NoCreateT) explicit noexcept
- Construct without creating the underlying OpenGL object.
- Renderbuffer(const Renderbuffer&) deleted
- Copying is not allowed.
- Renderbuffer(Renderbuffer&& other) noexcept
- Move constructor.
- ~Renderbuffer()
- Destructor.
Public functions
- auto operator=(const Renderbuffer&) -> Renderbuffer& deleted
- Copying is not allowed.
- auto operator=(Renderbuffer&& other) -> Renderbuffer& noexcept
- Move assignment.
- auto id() const -> GLuint
- OpenGL renderbuffer ID.
- auto release() -> GLuint
- Release OpenGL object.
-
auto label() -> std::
string - Renderbuffer label.
-
auto setLabel(const std::
string& label) -> Renderbuffer& - Set renderbuffer label.
-
template<std::auto setLabel(const char(&label)[size]) -> Renderbuffer&
size_t size> - void setStorage(RenderbufferFormat internalFormat, const Vector2i& size)
- Set renderbuffer storage.
- void setStorageMultisample(Int samples, RenderbufferFormat internalFormat, const Vector2i& size)
- Set multisample renderbuffer storage.
Function documentation
static Int Magnum:: GL:: Renderbuffer:: maxSamples()
Max supported sample count.
The result is cached, repeated queries don't result in repeated OpenGL calls. If neither OpenGL ES 3.0 nor ES extension ANGLE_0
.
static Renderbuffer Magnum:: GL:: Renderbuffer:: wrap(GLuint id,
ObjectFlags flags = {})
Wrap existing OpenGL renderbuffer object.
Parameters | |
---|---|
id | OpenGL renderbuffer ID |
flags | Object creation flags |
The id
is expected to be of an existing OpenGL renderbuffer object. Unlike renderbuffer created using constructor, the OpenGL object is by default not deleted on destruction, use flags
for different behavior.
Magnum:: GL:: Renderbuffer:: Renderbuffer() explicit
Constructor.
Generates new OpenGL renderbuffer object. If ARB_
Magnum:: GL:: Renderbuffer:: Renderbuffer(NoCreateT) explicit noexcept
Construct without creating the underlying OpenGL object.
The constructed instance is equivalent to moved-from state. Useful in cases where you will overwrite the instance later anyway. Move another object over it to make it useful.
This function can be safely used for constructing (and later destructing) objects even without any OpenGL context being active.
Magnum:: GL:: Renderbuffer:: ~Renderbuffer()
Destructor.
Deletes associated OpenGL renderbuffer object.
GLuint Magnum:: GL:: Renderbuffer:: release()
Release OpenGL object.
Releases ownership of OpenGL renderbuffer object and returns its ID so it is not deleted on destruction. The internal state is then equivalent to moved-from state.
std:: string Magnum:: GL:: Renderbuffer:: label()
Renderbuffer label.
The result is not cached, repeated queries will result in repeated OpenGL calls. If OpenGL 4.3 / OpenGL ES 3.2 is not supported and neither KHR_
Renderbuffer& Magnum:: GL:: Renderbuffer:: setLabel(const std:: string& label)
Set renderbuffer label.
Returns | Reference to self (for method chaining) |
---|
Default is empty string. If OpenGL 4.3 / OpenGL ES 3.2 is not supported and neither KHR_
template<std:: size_t size>
Renderbuffer& Magnum:: GL:: Renderbuffer:: setLabel(const char(&label)[size])
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Magnum:: GL:: Renderbuffer:: setStorage(RenderbufferFormat internalFormat,
const Vector2i& size)
Set renderbuffer storage.
Parameters | |
---|---|
internalFormat | Internal format |
size | Renderbuffer size |
If neither ARB_
void Magnum:: GL:: Renderbuffer:: setStorageMultisample(Int samples,
RenderbufferFormat internalFormat,
const Vector2i& size)
Set multisample renderbuffer storage.
Parameters | |
---|---|
samples | Sample count |
internalFormat | Internal format |
size | Renderbuffer size |
If neither ARB_