![]() | FramebufferBind Method |
Namespace: Ooogles
Framebuffer object names are unsigned integers. The value zero is reserved to represent the 'system' framebuffer provided by the windowing system. Framebuffer object names and the corresponding framebuffer object contents are local to the shared object space of the current GL rendering context.
You may use Framebuffer to generate a new framebuffer object name.
The state of a framebuffer object immediately after it is first bound is three attachment points (ColorAttachment, DepthAttachment, and StencilAttachment) each with None as the object type.
While a framebuffer object name is bound, all rendering to the framebuffer (with DrawArrays(glPrimitiveType, Int32) and DrawElements(glPrimitiveType, Byte)) and reading from the framebuffer (with ReadPixelsT(Int32, Int32, Int32, Int32, T, glPixelFormat, glPixelDataType), Copy(glPixelFormat, Int32, Int32, Int32, Int32, Int32, Int32), or SubCopy(Int32, Int32, Int32, Int32, Int32, Int32, Int32, Int32)) use the images attached to the application-created framebuffer object rather than the default window-system-provided framebuffer.
Application created framebuffer objects differ from the default window-system-provided framebuffer in a few important ways. First, they have modifiable attachment points for a color buffer, a depth buffer, and a stencil buffer to which framebuffer attachable images may be attached and detached. Second, the size and format of the attached images are controlled entirely within the GL and are not affected by window-system events, such as pixel format selection, window resizes, and display mode changes. Third, when rendering to or reading from an application created framebuffer object, the pixel ownership test always succeeds (i.e. they own all their pixels). Fourth, there are no visible color buffer bitplanes, only a single 'off-screen' color image attachment, so there is no sense of front and back buffers or swapping. Finally, there is no multisample buffer.
A framebuffer object binding created with Bind remains active until a different framebuffer object name is bound, or until the bound framebuffer object is deleted.
Note: you cannot unbind a framebuffer. If you want to revert back to the default framebuffer, then you should call Currentbefore you generate a new framebuffer. Then you can bind to the that framebuffer later to revert back to it.
OpenGL API: glBindFramebuffer