GLBINDFRAMEBUFFER(3G)

πŸ’… GLBINDFRAMEBUFFER(3G) πŸ’…

okay bestie, so this is the 3G page from the OpenGL manual and it's literally about gluing a framebuffer object to a framebuffer target. that's the whole vibe. let's go ✨


🌸 NAME 🌸

glBindFramebuffer β€” bind a framebuffer to a framebuffer target πŸŽ€


πŸ¦‹ C SPECIFICATION πŸ¦‹

void glBindFramebuffer(GLenum target, GLuint framebuffer);

πŸ“ PARAMETERS πŸ“

  • target β€” says which framebuffer target the binding operation happens on. that's it, that's the job πŸ’…
  • framebuffer β€” the name of the framebuffer object you wanna bind. the name, not the object itself, iykyk 🫢

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea β˜• β€” glBindFramebuffer binds the framebuffer object with name framebuffer to the framebuffer target specified by target.

and target must be either GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER or GL_FRAMEBUFFER. no third options, no vibes-based guessing, fr fr.

if a framebuffer object is bound to GL_DRAW_FRAMEBUFFER or GL_READ_FRAMEBUFFER, it becomes the target for rendering or readback operations, respectively 😀 β€” and it stays that way until it is deleted or another framebuffer is bound to the corresponding bind point. main character until evicted, basically.

calling glBindFramebuffer with target set to GL_FRAMEBUFFER binds framebuffer to both the read and draw framebuffer targets. two for one, iconic πŸ’–

and framebuffer is the name of a framebuffer object previously returned from a call to glGenFramebuffers(), or zero to break the existing binding of a framebuffer object to target. zero = the breakup arc πŸ₯€


πŸ’€ ERRORS πŸ’€

  • GL_INVALID_ENUM is generated if target is not GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER or GL_FRAMEBUFFER. wrong target, girlie, not cute πŸ™ˆ
  • GL_INVALID_OPERATION is generated if framebuffer is not zero or the name of a framebuffer previously returned from a call to glGenFramebuffers(). don't make up names, it never ends well 😭

🌈 VERSION SUPPORT 🌈

the vibe check by OpenGL version β€” this one's a late bloomer, she does not exist before 3.0:

  • 2.0 β€” nope, -
  • 2.1 β€” still nope, -
  • 3.0 β€” βœ” slay, she's here
  • 3.1 β€” βœ”
  • 3.2 β€” βœ”
  • 3.3 β€” βœ”
  • 4.0 β€” βœ”
  • 4.1 β€” βœ”
  • 4.2 β€” βœ”
  • 4.3 β€” βœ”
  • 4.4 β€” βœ”
  • 4.5 β€” βœ”

glBindFramebuffer: supported in every version from 3.0 all the way to 4.5, ate and left no crumbs πŸ‘‘


🧚 SEE ALSO 🧚

go read these next, bestie, they're all in the same friend group:

  • glGenFramebuffers()
  • glFramebufferRenderbuffer()
  • glFramebufferTexture()
  • glFramebufferTexture1D
  • glFramebufferTexture2D
  • glFramebufferTexture3D
  • glFramebufferTextureLayer()
  • glDeleteFramebuffers()
  • glIsFramebuffer()

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


okay that's the whole page!! 🫢 this cutie came from [FIXME: source], dated 08/09/2021, and she's GLBINDFRAMEBUFFER(3G) forever and always πŸ’œ go bind some framebuffers responsibly, mwah ✨

πŸ“¦ where this page comes from