21.06.2014 Views

OpenGL 4.2 (Compatibility Profile) - April 27, 2012

OpenGL 4.2 (Compatibility Profile) - April 27, 2012

OpenGL 4.2 (Compatibility Profile) - April 27, 2012

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.4. FRAMEBUFFER OBJECTS 429<br />

4.4.1 Binding and Managing Framebuffer Objects<br />

The default framebuffer for rendering and readback operations is provided by the<br />

window system. In addition, named framebuffer objects can be created and operated<br />

upon. The name space for framebuffer objects is the unsigned integers, with<br />

zero reserved by the GL for the default framebuffer.<br />

A framebuffer object is created by binding a name returned by GenFramebuffers<br />

(see below) to DRAW_FRAMEBUFFER or READ_FRAMEBUFFER. The binding<br />

is effected by calling<br />

void BindFramebuffer( enum target, uint framebuffer );<br />

with target set to the desired framebuffer target and framebuffer set to the framebuffer<br />

object name. The resulting framebuffer object is a new state vector, comprising<br />

all the state and with the same initial values listed in table 6.33, as well<br />

as one set of the state values listed in table 6.34 for each attachment point of the<br />

framebuffer, with the same initial values. There are the value of MAX_COLOR_-<br />

ATTACHMENTS color attachment points, plus one each for the depth and stencil<br />

attachment points.<br />

BindFramebuffer may also be used to bind an existing framebuffer object<br />

to DRAW_FRAMEBUFFER and/or READ_FRAMEBUFFER. If the bind is successful no<br />

change is made to the state of the newly bound framebuffer object, and any previous<br />

binding to target is broken.<br />

BindFramebuffer fails and an INVALID_OPERATION error is generated if<br />

framebuffer is not zero or a name returned from a previous call to GenFramebuffers,<br />

or if such a name has since been deleted with DeleteFramebuffers.<br />

If a framebuffer object is bound to DRAW_FRAMEBUFFER or READ_-<br />

FRAMEBUFFER, it becomes the target for rendering or readback operations, respectively,<br />

until it is deleted or another framebuffer object is bound to the corresponding<br />

bind point. Calling BindFramebuffer with target set to FRAMEBUFFER binds<br />

framebuffer to both the draw and read targets.<br />

While a framebuffer object is bound, GL operations on the target to which it is<br />

bound affect the images attached to the bound framebuffer object, and queries of<br />

the target to which it is bound return state from the bound object. Queries of the<br />

values specified in tables 6.77 and 6.33 are derived from the framebuffer object<br />

bound to DRAW_FRAMEBUFFER, with the exception of those marked as properties<br />

of the read framebuffer, which are derived from the framebuffer object bound to<br />

READ_FRAMEBUFFER.<br />

The initial state of DRAW_FRAMEBUFFER and READ_FRAMEBUFFER refers to<br />

the default framebuffer. In order that access to the default framebuffer is not lost,<br />

it is treated as a framebuffer object with the name of zero. The default framebuffer<br />

<strong>OpenGL</strong> <strong>4.2</strong> (<strong>Compatibility</strong> <strong>Profile</strong>) - <strong>April</strong> <strong>27</strong>, <strong>2012</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!