GLCHECKFRAMEBUFFERST(3G)

✨ glCheckFramebufferStatus, glCheckNamedFramebufferStatus β€” the 3G girlies πŸ’…

Okay bestie, welcome to the GLCHECKFRAMEBUFFERST(3G) page β€” yes the header line is literally still rocking a [FIXME: manual] placeholder, we love a work-in-progress era πŸŽ€. This is the one where you find out if your framebuffer is actually complete or just pretending. Let's get into it.


🌸 NAME

glCheckFramebufferStatus, glCheckNamedFramebufferStatus β€” check the completeness status of a framebuffer. That's it, that's the vibe check πŸ’–


πŸ¦‹ C SPECIFICATION

GLenum glCheckFramebufferStatus(GLenum target);

GLenum glCheckNamedFramebufferStatus(GLuint framebuffer, GLenum target);

Look at those signatures, so clean, so iconic ✨


πŸŽ€ PARAMETERS

  • target β€” for glCheckFramebufferStatus this is the target the framebuffer is bound to, and for glCheckNamedFramebufferStatus it's the target against which framebuffer completeness of framebuffer is checked. Yes it's doing double duty, she's versatile πŸ’…
  • framebuffer β€” the name of the framebuffer object, specifically for glCheckNamedFramebufferStatus. Bestie, this one's only for the named version, don't get it twisted 🫢

πŸ”₯ DESCRIPTION

So glCheckFramebufferStatus and glCheckNamedFramebufferStatus return the completeness status of a framebuffer object β€” like, when it's being treated as a read framebuffer or a draw framebuffer, depending on what target is. It's giving "are you okay? do you need to talk?" energy 😭

For glCheckFramebufferStatus, the framebuffer being checked is whatever's bound to target, and target must be GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER, or GL_FRAMEBUFFER. And heads up: GL_FRAMEBUFFER is equivalent to GL_DRAW_FRAMEBUFFER. Same thing, different font 🌈

For glCheckNamedFramebufferStatus, framebuffer is zero or the name of the framebuffer object you wanna check. If framebuffer is zero, then you get the status of the default read or draw framebuffer, as determined by target. Default behavior, no notes πŸ’«

The return value is GL_FRAMEBUFFER_COMPLETE if the specified framebuffer is complete. Slay! Otherwise, the return value is determined as follows β€” no cap, this list is long but every single one matters:

  • GL_FRAMEBUFFER_UNDEFINED is returned if the specified framebuffer is the default read or draw framebuffer, but the default framebuffer does not exist. She's not there, girl πŸ’€
  • GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT is returned if any of the framebuffer attachment points are framebuffer incomplete. One bad apple fr fr πŸ“
  • GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT is returned if the framebuffer does not have at least one image attached to it. Literally empty, not a single image, we can't work with that πŸ™ˆ
  • GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER is returned if the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_NONE for any color attachment point(s) named by GL_DRAW_BUFFERi. The draw buffer said "no ❀️" and it shows.
  • GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER is returned if GL_READ_BUFFER is not GL_NONE and the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_NONE for the color attachment point named by GL_READ_BUFFER. Same energy but for reading, iykyk πŸ’œ
  • GL_FRAMEBUFFER_UNSUPPORTED is returned if the combination of internal formats of the attached images violates an implementation-dependent set of restrictions. The formats just don't get along, it's not you it's the implementation ✨
  • GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE is returned if the value of GL_RENDERBUFFER_SAMPLES is not the same for all attached renderbuffers; if the value of GL_TEXTURE_SAMPLES is the not same for all attached textures; or, if the attached images are a mix of renderbuffers and textures, the value of GL_RENDERBUFFER_SAMPLES does not match the value of GL_TEXTURE_SAMPLES. (Yes, "is the not same" β€” that's how the original says it, we're not fixing it, we're respecting it 😌)
  • GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE is also returned if the value of GL_TEXTURE_FIXED_SAMPLE_LOCATIONS is not the same for all attached textures; or, if the attached images are a mix of renderbuffers and textures, the value of GL_TEXTURE_FIXED_SAMPLE_LOCATIONS is not GL_TRUE for all attached textures. Two whole bullets for the same error code β€” she's thorough, we stan πŸ‘‘
  • GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS is returned if any framebuffer attachment is layered, and any populated attachment is not layered, or if all populated color attachments are not from textures of the same target. Mixed vibes = mixed layers, and that's a no πŸ¦‹
And additionally, if an error occurs, zero is returned. That's your red flag that something went wrong, bestie 🚩

πŸ’€ ERRORS

  • GL_INVALID_ENUM is generated if target is not GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER or GL_FRAMEBUFFER. Wrong target, wrong energy, immediate error 😭
  • GL_INVALID_OPERATION is generated by glCheckNamedFramebufferStatus if framebuffer is not zero or the name of an existing framebuffer object. You can't check a framebuffer that doesn't exist, the audacity πŸ™ˆ

πŸ‘‘ VERSION SUPPORT

Okay so the original puts this in a whole big table, and we're doing it in list form because honestly it reads better. Same facts, cuter delivery πŸŽ€

glCheckFramebufferStatus

  • OpenGL 2.0 β€” - (nope)
  • OpenGL 2.1 β€” - (nope)
  • OpenGL 3.0 β€” βœ” (yes bestie)
  • OpenGL 3.1 β€” βœ”
  • OpenGL 3.2 β€” βœ”
  • OpenGL 3.3 β€” βœ”
  • OpenGL 4.0 β€” βœ”
  • OpenGL 4.1 β€” βœ”
  • OpenGL 4.2 β€” βœ”
  • OpenGL 4.3 β€” βœ”
  • OpenGL 4.4 β€” βœ”
  • OpenGL 4.5 β€” βœ”

glCheckNamedFramebufferStatus

  • OpenGL 2.0 β€” -
  • OpenGL 2.1 β€” -
  • OpenGL 3.0 β€” -
  • OpenGL 3.1 β€” -
  • OpenGL 3.2 β€” -
  • OpenGL 3.3 β€” -
  • OpenGL 4.0 β€” -
  • OpenGL 4.1 β€” -
  • OpenGL 4.2 β€” -
  • OpenGL 4.3 β€” -
  • OpenGL 4.4 β€” -
  • OpenGL 4.5 β€” βœ” (literally the only one, main character energy ⭐)

So the named version is a 4.5 exclusive β€” she arrived late and she arrived fashionably πŸ’…


🌟 SEE ALSO

Go check these out, they're the supporting cast 🫢

  • glGenFramebuffers()
  • glDeleteFramebuffers()
  • glBindFramebuffer()

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/.

Copyright Β© 2010-2014 Khronos Group

(Yeah, the page has the COPYRIGHT section twice β€” iconic of it honestly, we're keeping both πŸ’œ)


That's the whole page, bestie! The footer on this one says [FIXME: source], dated 08/09/2021, and it's still filed under GLCHECKFRAMEBUFFERST(3G) β€” so like, go forth and check those framebuffers, and remember: if you get a zero back, that's not a status, that's an error, and you deserve better πŸŒΈβœ¨πŸŽ€

πŸ“¦ where this page comes from