2005
Sams Publishing
glCheckFramebufferStatus
3G

# glCheckFramebufferStatus

return the framebuffer completeness status of a framebuffer object

## C Specification

                    GLenum glCheckFramebufferStatus
                    GLenum target

## Parameters

`target`

  Specifies the target framebuffer object. The symbolic constant must be `GL_FRAMEBUFFER`.

## Description

`glCheckFramebufferStatus` returns a symbolic constant that identifies whether or not the currently bound framebuffer is framebuffer complete, and if not, which of the rules of framebuffer completeness is violated.

If the framebuffer is complete, then `GL_FRAMEBUFFER_COMPLETE` is returned. If the framebuffer is not complete, the return values are as follows:

`GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT`

  Not all framebuffer attachment points are framebuffer attachment complete. This means that at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached.

  Color-renderable formats include `GL_RGBA4`, `GL_RGB5_A1`, and `GL_RGB565`. `GL_DEPTH_COMPONENT16` is the only depth-renderable format. `GL_STENCIL_INDEX8` is the only stencil-renderable format.

`GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS`

  Not all attached images have the same width and height.

`GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT`

  No images are attached to the framebuffer.

`GL_FRAMEBUFFER_UNSUPPORTED`

  The combination of internal formats of the attached images violates an implementation-dependent set of restrictions.

If the currently bound framebuffer is not framebuffer complete, then it is an error to attempt to use the framebuffer for writing or reading. This means that rendering commands (glClear, glDrawArrays, and glDrawElements) as well as commands that read the framebuffer (glReadPixels, glCopyTexImage2D, and glCopyTexSubImage2D) will generate the error `GL_INVALID_FRAMEBUFFER_OPERATION` if called while the framebuffer is not framebuffer complete.

## Notes

It is strongly advised, thought not required, that an application call `glCheckFramebufferStatus` to see if the framebuffer is complete prior to rendering. This is because some implementations may not support rendering to particular combinations of internal formats. In this case, `GL_FRAMEBUFFER_UNSUPPORTED` is returned.

The default window-system-provided framebuffer is always framebuffer complete, and thus `GL_FRAMEBUFFER_COMPLETE` is returned when `GL_FRAMEBUFFER_BINDING` is 0.

Additionally, if an error occurs, zero is returned.

## Errors

`GL_INVALID_ENUM` is generated if `target` is not `GL_FRAMEBUFFER`.

## See Also

glBindRenderbuffer, glCopyTexImage2D, glCopyTexSubImage2D, glDrawArrays, glDrawElements, glReadPixels, glRenderbufferStorage

## Copyright

Copyright 2008 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/.