GLGETFRAMEBUFFERATTA(3G)
π NAME π
okay bestie, welcome to GLGETFRAMEBUFFERATTA(3G) β the header has a little [FIXME: manual] moment, iconic, but we move. This page is all about:
glGetFramebufferAttachmentParameterivglGetNamedFramebufferAttachmentParameteriv
and they're here to retrieve information about attachments of a framebuffer object. no cap, that's the whole vibe. π
β¨ C SPECIFICATION β¨
void glGetFramebufferAttachmentParameteriv(GLenum target,
GLenum attachment,
GLenum pname, GLint *params);
void glGetNamedFramebufferAttachmentParameteriv(GLuint framebuffer,
GLenum attachment,
GLenum pname,
GLint *params);
πΈ PARAMETERS πΈ
targetβ Specifies the target to which the framebuffer object is bound forglGetFramebufferAttachmentParameteriv.framebufferβ Specifies the name of the framebuffer object forglGetNamedFramebufferAttachmentParameteriv.attachmentβ Specifies the attachment of the framebuffer object to query.pnameβ Specifies the parameter ofattachmentto query.paramsβ Returns the value of parameterpnameforattachment.
π¦ DESCRIPTION π¦
glGetFramebufferAttachmentParameteriv and glGetNamedFramebufferAttachmentParameteriv return parameters of attachments of a specified framebuffer object. literally their whole job. π
For glGetFramebufferAttachmentParameteriv, the framebuffer object is the one bound to target, which must be one of GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER or GL_FRAMEBUFFER. GL_FRAMEBUFFER is equivalent to GL_DRAW_FRAMEBUFFER. Buffers of default framebuffers may also be queried if bound to target.
For glGetNamedFramebufferAttachmentParameteriv, framebuffer is the name of the framebuffer object. If framebuffer is zero, the default draw framebuffer is queried.
If the specified framebuffer is a framebuffer object, attachment must be one of GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT, GL_DEPTH_STENCIL_ATTACHMENT, or GL_COLOR_ATTACHMENTi, where i is between zero and the value of GL_MAX_COLOR_ATTACHMENTS minus one.
If the specified framebuffer is a default framebuffer, attachment must be one of GL_FRONT_LEFT, GL_FRONT_RIGHT, GL_BACK_LEFT, GL_BACK_RIGHT, GL_DEPTH or GL_STENCIL, identifying the corresponding buffer.
If attachment is GL_DEPTH_STENCIL_ATTACHMENT, the same object must be bound to both the depth and stencil attachment points of the framebuffer object, and information about that object is returned.
Upon successful return, if pname is GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, then params will contain one of GL_NONE, GL_FRAMEBUFFER_DEFAULT, GL_TEXTURE, or GL_RENDERBUFFER, identifying the type of object which contains the attached image. Other values accepted for pname depend on the type of object, as described below.
If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_NONE, then either no framebuffer is bound to target; or a default framebuffer is queried, attachment is GL_DEPTH or GL_STENCIL, and the number of depth or stencil bits, respectively, is zero. In this case querying pname GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME will return zero, and all other queries will generate an error. π«Ά
If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is not GL_NONE, these queries apply to all other framebuffer types:
- If
pnameisGL_FRAMEBUFFER_ATTACHMENT_RED_SIZE,GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE,GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE,GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE,GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZEorGL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, thenparamswill contain the number of bits in the corresponding red, green, blue, alpha, depth, or stencil component of the specified attachment. If the requested component is not present in the attachment, or if no data storage or texture image has been specified for the attachment, thenparamswill contain zero. - If
pnameisGL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, thenparamswill contain the format of components of the specified attachment, one ofGL_FLOAT,GL_INT,GL_UNSIGNED_INT,GL_SIGNED_NORMALIZED, orGL_UNSIGNED_NORMALIZEDfor floating-point, signed integer, unsigned integer, signed normalized fixed-point, or unsigned normalized fixed-point components respectively. Only color buffers may have integer components. If no data storage or texture image has been specified for the attachment, thenparamswill containGL_NONE. This query cannot be performed for a combined depth+stencil attachment, since it does not have a single format. - If
pnameisGL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING, thenparamswill contain the encoding of components of the specified attachment, one ofGL_LINEARorGL_SRGBfor linear or sRGB-encoded components, respectively. Only color buffer components may be sRGB-encoded; such components are treated as described in the OpenGL Specification. For a default framebuffer, color encoding is determined by the implementation. For framebuffer objects, components are sRGB-encoded if the internal format of a color attachment is one of the color-renderable SRGB formats. If the attachment is not a color attachment, or if no data storage or texture image has been specified for the attachment, thenparamswill containGL_LINEAR.
If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_RENDERBUFFER, then:
- If
pnameisGL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME,paramswill contain the name of the renderbuffer object which contains the attached image.
If the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_TEXTURE, then:
- If
pnameisGL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, thenparamswill contain the name of the texture object which contains the attached image. - If
pnameisGL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, thenparamswill contain the mipmap level of the texture object which contains the attached image. - If
pnameisGL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACEand the value ofGL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAMEis the name of a cube map texture object, thenparamswill contain the cube map face of the cubemap texture object which contains the attached image. Otherwiseparamswill contain zero. - If
pnameisGL_FRAMEBUFFER_ATTACHMENT_LAYERED, thenparamswill containGL_TRUEif an entire level of a three-dimensional texture, cube map texture, or one-or two-dimensional array texture is attached. Otherwise,paramswill containGL_FALSE. - If
pnameisGL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER; the value ofGL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAMEis the name of a three-dimensional, or a one- or two-dimensional array texture; and the value ofGL_FRAMEBUFFER_ATTACHMENT_LAYEREDisGL_FALSE, thenparamswill contain the texture layer which contains the attached image. Otherwiseparamswill contain zero.
π NOTES π
The GL_FRAMEBUFFER_ATTACHMENT_LAYERED query is supported only if the GL version is 3.2 or greater. periodt. π
π₯ ERRORS π₯
GL_INVALID_ENUMis generated byglGetFramebufferAttachmentParameteriviftargetis not one of the accepted framebuffer targets.GL_INVALID_OPERATIONis generated byglGetNamedFramebufferAttachmentParameterivifframebufferis not zero or the name of an existing framebuffer object.GL_INVALID_ENUMis generated ifpnameis not valid for the value ofGL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, as described above.GL_INVALID_OPERATIONis generated ifattachmentis not one of the accepted framebuffer attachment points, as described above.GL_INVALID_OPERATIONis generated if the value ofGL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPEisGL_NONEandpnameis notGL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAMEorGL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE.GL_INVALID_OPERATIONis generated ifattachmentisGL_DEPTH_STENCIL_ATTACHMENTand different objects are bound to the depth and stencil attachment points oftarget.GL_INVALID_OPERATIONis generated ifattachmentisGL_DEPTH_STENCIL_ATTACHMENTandpnameisGL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE.
π VERSION SUPPORT π
OpenGL versions 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5 β here's the vibe check:
glGetFramebufferAttachmentParameteriv2.0:-2.1:-3.0:β3.1:β3.2:β3.3:β4.0:β4.1:β4.2:β4.3:β4.4:β4.5:β
glGetNamedFramebufferAttachmentParameteriv2.0:-2.1:-3.0:-3.1:-3.2:-3.3:-4.0:-4.1:-4.2:-4.3:-4.4:-4.5:β
β¨ SEE ALSO β¨
ok so if you're done here and you wanna go poke at the related stuff, these are the ones you want, bestie β go read up on them fr fr:
glGenFramebuffers()β makes you some shiny new framebuffer objects πglBindFramebuffer()β binds one so it's the current main character πglGetFramebufferParameter()β the sibling query, gets a single parameter back π¦
ngl, the original page lists these three in one line like glGenFramebuffers(), glBindFramebuffer() glGetFramebufferParameter() β yes, the comma situation is a little chaotic π but those are the three functions, no cap.
π COPYRIGHT π
ok legal moment, don't skip it, it's giving very important:
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 (yes, again, it's listed twice) πΈ
Copyright Β© 2010-2014 Khronos Group
literally the same copyright line, just vibing on its own the second time around β the manpage said it twice so I'm telling you twice π periodt.
and that's the whole page, bestie!! you made it!! π«Ά
tiny sign-off just so you have the receipts: this one's from the [FIXME: source] situation (yeah, the source field is literally a FIXME π iconic of them), dated 08/09/2021, and it lives under the name GLGETFRAMEBUFFERATTA(3G). slay, go write some framebuffer code now π
β¨
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms