GLRENDERBUFFERSTORAG(3G)

πŸ’… GLRENDERBUFFERSTORAG(3G) β€” bestie edition

ok so first things first: this is a page from the 3G manual section (yep, the OpenGL one), and the header even has a lil [FIXME: manual] placeholder in it, which, honestly? iconic messy. anyways, buckle up πŸŽ€


✨ NAME ✨

glRenderbufferStorage, glNamedRenderbufferStorage β€” establish data storage, format and dimensions of a renderbuffer object's image πŸ–ΌοΈ

like literally, these two functions set up the actual storage for a renderbuffer's image, plus its format and its dimensions. that's the whole vibe.


🧾 C SPECIFICATION 🧾

no cap, here's the exact signatures, character for character:

void glRenderbufferStorage(GLenum target, GLenum internalformat,
                           GLsizei width, GLsizei height);

void glNamedRenderbufferStorage(GLuint renderbuffer,
                                GLenum internalformat, GLsizei width,
                                GLsizei height);

🌸 PARAMETERS 🌸

  • target β€” specifies a binding target of the allocation for the glRenderbufferStorage function. must be GL_RENDERBUFFER. that's it, that's the only valid answer bestie πŸ’…
  • renderbuffer β€” specifies the name of the renderbuffer object for the glNamedRenderbufferStorage function. πŸ‘‘
  • internalformat β€” specifies the internal format to use for the renderbuffer object's image.
  • width β€” specifies the width of the renderbuffer, in pixels. πŸ“
  • height β€” specifies the height of the renderbuffer, in pixels. πŸ“

πŸ¦‹ DESCRIPTION πŸ¦‹

ok so the tea β˜•: glRenderbufferStorage is equivalent to calling glRenderbufferStorageMultisample() with the samples set to zero. and glNamedRenderbufferStorage is equivalent to calling glNamedRenderbufferStorageMultisample with the samples set to zero. so like, the multisample versions but with zero samples. slay, but make it single-sample ✨

for glRenderbufferStorage, the target of the operation, specified by target, must be GL_RENDERBUFFER. for glNamedRenderbufferStorage, renderbuffer must be a name of an existing renderbuffer object β€” like, it has to actually exist, no imaginary friends πŸ™ˆ

internalformat specifies the internal format to be used for the renderbuffer object's storage, and it must be a color-renderable, depth-renderable, or stencil-renderable format. width and height are the dimensions, in pixels, of the renderbuffer. both width and height must be less than or equal to the value of GL_MAX_RENDERBUFFER_SIZE. respectfully, do not test this 🫢

upon success, glRenderbufferStorage and glNamedRenderbufferStorage delete any existing data store for the renderbuffer image, and the contents of the data store after calling glRenderbufferStorage are undefined. so yeah β€” the old data is gone gone, and what's in there after? nobody knows. mystery era πŸ’€


πŸ’€ ERRORS πŸ’€

here's where it gets real, bestie. these are the ways your call can fail:

  • GL_INVALID_ENUM is generated by glRenderbufferStorage if target is not GL_RENDERBUFFER.
  • GL_INVALID_OPERATION is generated by glNamedRenderbufferStorage if renderbuffer is not the name of an existing renderbuffer object.
  • GL_INVALID_VALUE is generated if either of width or height is negative, or greater than the value of GL_MAX_RENDERBUFFER_SIZE. (negative pixels?? be so fr 😭)
  • GL_INVALID_ENUM is generated if internalformat is not a color-renderable, depth-renderable, or stencil-renderable format.
  • GL_OUT_OF_MEMORY is generated if the GL is unable to create a data store of the requested size.

🌈 VERSION SUPPORT 🌈

the original has this in a big grid β€” Function/Feature Name down the side, OpenGL Version 2.0 through 4.5 across the top β€” but grids are ugly in a terminal so here's the same info, gorgeous and readable πŸ’–

glNamedRenderbufferStorage

  • 2.0 β€” -
  • 2.1 β€” -
  • 3.0 β€” -
  • 3.1 β€” -
  • 3.2 β€” -
  • 3.3 β€” -
  • 4.0 β€” -
  • 4.1 β€” -
  • 4.2 β€” -
  • 4.3 β€” -
  • 4.4 β€” -
  • 4.5 β€” βœ”

like, it's a 4.5 only babe. it simply did not exist before then πŸŽ€

glRenderbufferStorage

  • 2.0 β€” -
  • 2.1 β€” -
  • 3.0 β€” βœ”
  • 3.1 β€” βœ”
  • 3.2 β€” βœ”
  • 3.3 β€” βœ”
  • 4.0 β€” βœ”
  • 4.1 β€” βœ”
  • 4.2 β€” βœ”
  • 4.3 β€” βœ”
  • 4.4 β€” βœ”
  • 4.5 β€” βœ”

from 3.0 onward, it ate and left no crumbs πŸ”₯


πŸ‘€ SEE ALSO πŸ‘€

go read these next, iykyk:

  • glGenRenderbuffers()
  • glBindRenderbuffer()
  • glNamedRenderbufferStorageMultisample
  • glRenderbufferStorageMultisample()
  • glFramebufferRenderbuffer()
  • glDeleteRenderbuffers()

Copyright Β© 2010-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

and again, because the page says it twice and i keep every detail, periodt:

Copyright Β© 2010-2014 Khronos Group


mwah πŸ’‹ that's the page!! the footer says [FIXME: source] and dates it 08/09/2021, and it's the GLRENDERBUFFERSTORAG(3G) page from your 3G manual. go forth and allocate responsibly, bestie 🫢✨

πŸ“¦ where this page comes from