GLAPI/glBindFramebuffer: Difference between revisions

From OpenGL Wiki
Jump to navigation Jump to search
m Bot: Adjusting API page category.
m Bot: Adding better formatting.
 
(4 intermediate revisions by the same user not shown)
Line 8: Line 8:
== Function Definition ==
== Function Definition ==


   void '''glBindFramebuffer'''(GLenum ''target'', GLuint ''framebuffer'');
   void '''glBindFramebuffer'''(GLenum {{param|target}}, GLuint {{param|framebuffer}});


; target
; target
Line 17: Line 17:
== Description ==
== Description ==


'''glBindFramebuffer''' binds the framebuffer object with name ''framebuffer'' to the framebuffer target specified by ''target''. ''target'' must be either {{code|GL_DRAW_FRAMEBUFFER}}, {{code|GL_READ_FRAMEBUFFER}} or {{code|GL_FRAMEBUFFER}}. If a framebuffer object is bound to {{code|GL_DRAW_FRAMEBUFFER}} or {{code|GL_READ_FRAMEBUFFER}}, it becomes the target for rendering or readback operations, respectively, until it is deleted or another framebuffer is bound to the corresponding bind point. Calling '''glBindFramebuffer''' with ''target'' set to {{code|GL_FRAMEBUFFER}} binds ''framebuffer'' to both the read and draw framebuffer targets. ''framebuffer'' is the name of a framebuffer object previously returned from a call to [[GLAPI/glGenFramebuffers|glGenFramebuffers]], or zero to break the existing binding of a framebuffer object to ''target''.
'''glBindFramebuffer''' binds the framebuffer object with name {{param|framebuffer}} to the framebuffer target specified by {{param|target}}. {{param|target}} must be either {{enum|GL_DRAW_FRAMEBUFFER}}, {{enum|GL_READ_FRAMEBUFFER}} or {{enum|GL_FRAMEBUFFER}}. If a framebuffer object is bound to {{enum|GL_DRAW_FRAMEBUFFER}} or {{enum|GL_READ_FRAMEBUFFER}}, it becomes the target for rendering or readback operations, respectively, until it is deleted or another framebuffer is bound to the corresponding bind point. Calling '''glBindFramebuffer''' with {{param|target}} set to {{enum|GL_FRAMEBUFFER}} binds {{param|framebuffer}} to both the read and draw framebuffer targets. {{param|framebuffer}} is the name of a framebuffer object previously returned from a call to {{apifunc|glGenFramebuffers}}, or zero to break the existing binding of a framebuffer object to {{param|target}}.


== Errors ==
== Errors ==


{{code|GL_INVALID_ENUM}} is generated if ''target'' is not {{code|GL_DRAW_FRAMEBUFFER}}, {{code|GL_READ_FRAMEBUFFER}} or {{code|GL_FRAMEBUFFER}}.
{{enum|GL_INVALID_ENUM}} is generated if {{param|target}} is not {{enum|GL_DRAW_FRAMEBUFFER}}, {{enum|GL_READ_FRAMEBUFFER}} or {{enum|GL_FRAMEBUFFER}}.


{{code|GL_INVALID_OPERATION}} is generated if ''framebuffer'' is not zero or the name of a framebuffer previously returned from a call to [[GLAPI/glGenFramebuffers|glGenFramebuffers]].
{{enum|GL_INVALID_OPERATION}} is generated if {{param|framebuffer}} is not zero or the name of a framebuffer previously returned from a call to {{apifunc|glGenFramebuffers}}.


== See Also ==
== See Also ==


[[GLAPI/glGenFramebuffers|glGenFramebuffers]], [[GLAPI/glDeleteFramebuffers|glDeleteFramebuffers]], [[GLAPI/glFramebufferRenderbuffer|glFramebufferRenderbuffer]], [[GLAPI/glFramebufferTexture|glFramebufferTexture]], [[GLAPI/glFramebufferTexture1D|glFramebufferTexture1D]], [[GLAPI/glFramebufferTexture2D|glFramebufferTexture2D]], [[GLAPI/glFramebufferTexture3D|glFramebufferTexture3D]], [[GLAPI/glFramebufferTextureLayer|glFramebufferTextureLayer]], [[GLAPI/glIsFramebuffer|glIsFramebuffer]]
{{apifunc|glGenFramebuffers}}, {{apifunc|glDeleteFramebuffers}}, {{apifunc|glIsFramebuffer}}, {{apifunc|glFramebufferRenderbuffer}}, {{apifunc|glFramebufferTexture}}, {{apifunc|glFramebufferTextureLayer}}, {{apifunc|glBlitFramebuffer}}, {{apifunc|glCheckFramebufferStatus}}, {{apifunc|glDrawBuffers}}, {{apifunc|glDrawBuffer}}, {{apifunc|glReadBuffer}}, {{apifunc|glReadPixels}}, {{apifunc|glFramebufferParameter}}, {{apifunc|glInvalidateFramebuffer}}, {{apifunc|glInvalidateSubFramebuffer}}


== Copyright ==
== Copyright ==
Line 33: Line 33:
Copyright © 2010 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/ http://opencontent.org/openpub/].
Copyright © 2010 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/ http://opencontent.org/openpub/].


[[Category:API Reference 4|BindFramebuffer]]
[[Category:Core API Ref Framebuffer Objects|BindFramebuffer]]
[[Category:GL 4 API Framebuffer Objects|BindFramebuffer]]
[[Category:Core API Reference|BindFramebuffer]]

Latest revision as of 01:39, 27 September 2012

glBindFramebuffer
Core in version 4.6
Core since version 3.0

glBindFramebuffer: bind a framebuffer to a framebuffer target

Function Definition

 void glBindFramebuffer(GLenum target​, GLuint framebuffer​);
target
Specifies the framebuffer target of the binding operation.
framebuffer
Specifies the name of the framebuffer object to bind.

Description

glBindFramebuffer binds the framebuffer object with name framebuffer​ to the framebuffer target specified by target​. target​ must be either GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER or GL_FRAMEBUFFER. If a framebuffer object is bound to GL_DRAW_FRAMEBUFFER or GL_READ_FRAMEBUFFER, it becomes the target for rendering or readback operations, respectively, until it is deleted or another framebuffer is bound to the corresponding bind point. Calling glBindFramebuffer with target​ set to GL_FRAMEBUFFER binds framebuffer​ to both the read and draw framebuffer targets. 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​.

Errors

GL_INVALID_ENUM is generated if target​ is not GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER or GL_FRAMEBUFFER.

GL_INVALID_OPERATION is generated if framebuffer​ is not zero or the name of a framebuffer previously returned from a call to glGenFramebuffers.

See Also

glGenFramebuffers, glDeleteFramebuffers, glIsFramebuffer, glFramebufferRenderbuffer, glFramebufferTexture, glFramebufferTextureLayer, glBlitFramebuffer, glCheckFramebufferStatus, glDrawBuffers, glDrawBuffer, glReadBuffer, glReadPixels, glFramebufferParameter, glInvalidateFramebuffer, glInvalidateSubFramebuffer

Copyright

Copyright © 2010 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/.