GLGETFRAMEBUFFERPARA(3G)

okay bestie, welcome to a section 3G manual page (iykyk, it's the OpenGL corner of the internet ✨) and honestly? it's giving "tiny function, big feelings." we're querying framebuffer object parameters today and you're gonna slay it πŸ’…

🌸 NAME 🌸

glGetFramebufferParameteriv, glGetNamedFramebufferParameteriv β€” query a named parameter of a framebuffer object πŸŽ€


✨ C SPECIFICATION ✨

like, literally copy these exactly, no cap:

void glGetFramebufferParameteriv(GLenum target, GLenum pname,
                                 GLint *params);

void glGetNamedFramebufferParameteriv(GLuint framebuffer, GLenum pname,
                                      GLint *param);

πŸ¦‹ PARAMETERS πŸ¦‹

  • target β€” tells us which target the framebuffer object is bound to, for glGetFramebufferParameteriv. that's the whole vibe check.
  • framebuffer β€” the name of the framebuffer object, for glGetNamedFramebufferParameteriv. yes bestie, you gotta name it.
  • pname β€” the parameter of the framebuffer object you wanna query. pick your fighter πŸ’–
  • params β€” where the value of parameter pname for the framebuffer object gets returned. it's the output slot, the little mailbox πŸ“¬

πŸ‘‘ DESCRIPTION πŸ‘‘

glGetFramebufferParameteriv and glGetNamedFramebufferParameteriv query parameters of a specified framebuffer object. that's it, that's the whole job, and they ate πŸ”₯

so for glGetFramebufferParameteriv, the framebuffer object is the one bound to target, which must be one of GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER or GL_FRAMEBUFFER. and heads up: GL_FRAMEBUFFER is equivalent to GL_DRAW_FRAMEBUFFER. default framebuffers may also be queried if bound to target. no gatekeeping πŸ’œ

for glGetNamedFramebufferParameteriv, framebuffer is the name of the framebuffer object. and if framebuffer is zero, the default draw framebuffer is queried. zero = the default one, noted πŸ“

upon successful return, param will contain the value of the framebuffer parameter specified by pname, as described below. (yes bestie, param here β€” the docs switch between param and params and honestly that's just the lore at this point 😭)

πŸ“ the exclusive club: parameters that can ONLY be queried for framebuffer objects

  • GL_FRAMEBUFFER_DEFAULT_WIDTH β€” params returns the value of GL_FRAMEBUFFER_DEFAULT_WIDTH for the framebuffer object.
  • GL_FRAMEBUFFER_DEFAULT_HEIGHT β€” params returns the value of GL_FRAMEBUFFER_DEFAULT_HEIGHT for the framebuffer object.
  • GL_FRAMEBUFFER_DEFAULT_LAYERS β€” params returns the value of GL_FRAMEBUFFER_DEFAULT_LAYERS for the framebuffer object.
  • GL_FRAMEBUFFER_DEFAULT_SAMPLES β€” params returns the value of GL_FRAMEBUFFER_DEFAULT_SAMPLES for the framebuffer object.
  • GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS β€” params returns the boolean value of GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS.

🌈 the everyone's-invited list: parameters you can query for BOTH default framebuffers and framebuffer objects

  • GL_DOUBLEBUFFER β€” param returns a boolean value indicating whether double buffering is supported for the framebuffer object.
  • GL_IMPLEMENTATION_COLOR_READ_FORMAT β€” param returns a GLenum value indicating the preferred pixel data format for the framebuffer object. see glReadPixels().
  • GL_IMPLEMENTATION_COLOR_READ_TYPE β€” param returns a GLenum value indicating the implementation's preferred pixel data type for the framebuffer object. see glReadPixels().
  • GL_SAMPLES β€” param returns an integer value indicating the coverage mask size for the framebuffer object. see glSampleCoverage().
  • GL_SAMPLE_BUFFERS β€” param returns an integer value indicating the number of sample buffers associated with the framebuffer object. see glSampleCoverage().
  • GL_STEREO β€” param returns a boolean value indicating whether stereo buffers (left and right) are supported for the framebuffer object.

🧚 NOTES 🧚

okay so bestie, the version gatekeeping is real here, pls read πŸ™ˆ

queries of default framebuffers are supported only if the GL version is 4.5 or higher. otherwise, an GL_INVALID_OPERATION error is generated. like, literally, it will not happen for you. πŸ’€

queries of the framebuffer-dependent parameters GL_DOUBLEBUFFER, GL_IMPLEMENTATION_COLOR_READ_FORMAT, GL_IMPLEMENTATION_COLOR_READ_TYPE, GL_SAMPLES, GL_SAMPLE_BUFFERS and GL_STEREO are supported only if the GL version is 4.5 or higher.

and the framebuffer-dependent state GL_SAMPLE_POSITION cannot be queried with these commands. nope. not these ones. not today. 🚫

πŸ’€ ERRORS πŸ’€

  • GL_INVALID_ENUM is generated by glGetFramebufferParameteriv if target is not one of the accepted framebuffer targets.
  • GL_INVALID_OPERATION is generated by glGetNamedFramebufferAttachmentParameteriv if framebuffer is not zero or the name of an existing framebuffer object.
  • GL_INVALID_ENUM is generated if pname is not one of the accepted parameter names.
  • GL_INVALID_OPERATION is generated if a default framebuffer is queried, and pname is not one of GL_DOUBLEBUFFER, GL_IMPLEMENTATION_COLOR_READ_FORMAT, GL_IMPLEMENTATION_COLOR_READ_TYPE, GL_SAMPLES, GL_SAMPLE_BUFFERS or GL_STEREO.

🫢 ASSOCIATED GETS 🫢

glGetFramebufferAttachmentParameter()

⭐ VERSION SUPPORT ⭐

so the original is a big gorgeous table with an OpenGL Version header spanning columns 2.0 2.1 3.0 3.1 3.2 3.3 4.0 4.1 4.2 4.3 4.4 4.5, and rows labelled Function / Feature Name. here's that whole energy translated, no details missing πŸ’–

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

πŸ”₯ SEE ALSO πŸ”₯

  • glFramebufferParameteri()
  • glGetFramebufferAttachmentParameter()

Copyright Β© 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 Β© 2014 Khronos Group


and that's the whole page bestie πŸ’œ the footer energy is [FIXME: source] and the date 08/09/2021, so like... shoutout to whoever's still fixing that source tag, you're the main character 🌟 mwah πŸ’‹

πŸ“¦ where this page comes from