Light | Dark

# docs.GL

OpenGL 4

# glGetFramebufferParameter

## Name

glGetFramebufferParameteriv, glGetNamedFramebufferParameteriv — query a named parameter of a framebuffer object

## C Specification

`void glGetFramebufferParameteriv(` | GLenum target,
| GLenum pname,
| GLint *params`)`;

`void glGetNamedFramebufferParameteriv(` | GLuint framebuffer,
| GLenum pname,
| GLint *param`)`;

## Parameters

`target`

  Specifies the target to which the framebuffer object is bound for `glGetFramebufferParameteriv`.

`framebuffer`

  Specifies the name of the framebuffer object for `glGetNamedFramebufferParameteriv`.

`pname`

  Specifies the parameter of the framebuffer object to query.

`params`

  Returns the value of parameter `pname` for the framebuffer object.

## Description

`glGetFramebufferParameteriv` and `glGetNamedFramebufferParameteriv` query parameters of a specified framebuffer object.

For `glGetFramebufferParameteriv`, the framebuffer object is that bound to `target`, which must be one of `GL_DRAW_FRAMEBUFFER`, `GL_READ_FRAMEBUFFER` or `GL_FRAMEBUFFER`. `GL_FRAMEBUFFER` is equivalent to `GL_DRAW_FRAMEBUFFER`. Default framebuffers may also be queried if bound to `target`.

For `glGetNamedFramebufferParameteriv`, `framebuffer` is the name of the framebuffer object. If `framebuffer` is zero, the default draw framebuffer is queried.

Upon successful return, `param` will contain the value of the framebuffer parameter specified by `pname`, as described below.

The following parameters can only be queried for framebuffer objects:

`GL_FRAMEBUFFER_DEFAULT_WIDTH`

  `params` returns the value of `GL_FRAMEBUFFER_DEFAULT_WIDTH` for the framebuffer object.

`GL_FRAMEBUFFER_DEFAULT_HEIGHT`

  `params` returns the value of `GL_FRAMEBUFFER_DEFAULT_HEIGHT` for the framebuffer object.

`GL_FRAMEBUFFER_DEFAULT_LAYERS`

  `params` returns the value of `GL_FRAMEBUFFER_DEFAULT_LAYERS` for the framebuffer object.

`GL_FRAMEBUFFER_DEFAULT_SAMPLES`

  `params` returns the value of `GL_FRAMEBUFFER_DEFAULT_SAMPLES` for the framebuffer object.

`GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS`

  `params` returns the boolean value of `GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS`.

The following parameters can be queried for both default framebuffers and framebuffer objects:

`GL_DOUBLEBUFFER`

  `param` returns a boolean value indicating whether double buffering is supported for the framebuffer object.

`GL_IMPLEMENTATION_COLOR_READ_FORMAT`

  `param` returns a GLenum value indicating the preferred pixel data format for the framebuffer object. See glReadPixels.

`GL_IMPLEMENTATION_COLOR_READ_TYPE`

  `param` returns a GLenum value indicating the implementation's preferred pixel data type for the framebuffer object. See glReadPixels.

`GL_SAMPLES`

  `param` returns an integer value indicating the coverage mask size for the framebuffer object. See glSampleCoverage.

`GL_SAMPLE_BUFFERS`

  `param` returns an integer value indicating the number of sample buffers associated with the framebuffer object. See glSampleCoverage.

`GL_STEREO`

  `param` returns a boolean value indicating whether stereo buffers (left and right) are supported for the framebuffer object.

## Notes

Queries of default framebuffers are supported only if the GL version is 4.5 or higher. Otherwise, an `GL_INVALID_OPERATION` error is generated.

Queries of the framebuffer-dependent parameters `GL_DOUBLEBUFFER`, `GL_IMPLEMENTATION_COLOR_READ_FORMAT`, `GL_IMPLEMENTATION_COLOR_READ_TYPE`, `GL_SAMPLES`, `GL_SAMPLE_BUFFERS` and `GL_STEREO` are supported only if the GL version is 4.5 or higher.

The framebuffer-dependent state `GL_SAMPLE_POSITION` cannot be queried with these commands.

## Errors

`GL_INVALID_ENUM` is generated by `glGetFramebufferParameteriv` if `target` is not one of the accepted framebuffer targets.

`GL_INVALID_OPERATION` is generated by `glGetNamedFramebufferAttachmentParameteriv` if `framebuffer` is not zero or the name of an existing framebuffer object.

`GL_INVALID_ENUM` is generated if `pname` is not one of the accepted parameter names.

`GL_INVALID_OPERATION` is generated if a default framebuffer is queried, and `pname` is not one of `GL_DOUBLEBUFFER`, `GL_IMPLEMENTATION_COLOR_READ_FORMAT`, `GL_IMPLEMENTATION_COLOR_READ_TYPE`, `GL_SAMPLES`, `GL_SAMPLE_BUFFERS` or `GL_STEREO`.

## Associated Gets

glGetFramebufferAttachmentParameter

## Version Support

| OpenGL Version
--- | ---
Function / Feature Name | 2.0 | 2.1 | 3.0 | 3.1 | 3.2 | 3.3 | 4.0 | 4.1 | 4.2 | 4.3 | 4.4 | 4.5
`glGetFramebufferParameteriv` | - | - | - | - | - | - | - | - | - | ✔ | ✔ | ✔
`glGetNamedFramebufferParameteriv` | - | - | - | - | - | - | - | - | - | - | - | ✔

## See Also

glFramebufferParameteri, glGetFramebufferAttachmentParameter

## Copyright

Copyright © 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. https://opencontent.org/openpub/.

Think you can improve this page? Edit this page on GitHub.