glFramebufferParameteri

Name

glFramebufferParameteri, glNamedFramebufferParameteri — set a named parameter of a framebuffer object

C Specification

 void glFramebufferParameteri( GLenum target, GLenum pname, GLint param);

 void glNamedFramebufferParameteri( GLuint framebuffer, GLenum pname, GLint param);

Parameters

target

Specifies the target to which the framebuffer is bound for glFramebufferParameteri.

framebuffer

Specifies the name of the framebuffer object for glNamedFramebufferParameteri.

pname

Specifies the framebuffer parameter to be modified.

param

The new value for the parameter named pname.

Description

glFramebufferParameteri and glNamedFramebufferParameteri modify the value of the parameter named pname in the specified framebuffer object. There are no modifiable parameters of the default draw and read framebuffer, so they are not valid targets of these commands.

For glFramebufferParameteri, the framebuffer object is that bound to target, which must be GL_DRAW_FRAMEBUFFER, GL_READ_FRAMEBUFFER or GL_FRAMEBUFFER. GL_FRAMEBUFFER is equivalent to GL_DRAW_FRAMEBUFFER.

For glNamedFramebufferParameteri, framebuffer is the name of the framebuffer object.

pname specifies the parameter to be modified. The following values are accepted:

GL_FRAMEBUFFER_DEFAULT_WIDTH

param specifies the assumed with for a framebuffer object with no attachments. If a framebuffer has attachments then the width of those attachments is used, otherwise the value of GL_FRAMEBUFFER_DEFAULT_WIDTH is used for the framebuffer. param must be greater than or equal to zero and less than or equal to the value of GL_MAX_FRAMEBUFFER_WIDTH.

GL_FRAMEBUFFER_DEFAULT_HEIGHT

param specifies the assumed height for a framebuffer object with no attachments. If a framebuffer has attachments then the height of those attachments is used, otherwise the value of GL_FRAMEBUFFER_DEFAULT_HEIGHT is used for the framebuffer. param must be greater than or equal to zero and less than or equal to the value of GL_MAX_FRAMEBUFFER_HEIGHT.

GL_FRAMEBUFFER_DEFAULT_LAYERS

param specifies the assumed number of layers for a framebuffer object with no attachments. If a framebuffer has attachments then the layer count of those attachments is used, otherwise the value of GL_FRAMEBUFFER_DEFAULT_LAYERS is used for the framebuffer. param must be greater than or equal to zero and less than or equal to the value of GL_MAX_FRAMEBUFFER_LAYERS.

GL_FRAMEBUFFER_DEFAULT_SAMPLES

param specifies the assumed number of samples in a framebuffer object with no attachments. If a framebuffer has attachments then the sample count of those attachments is used, otherwise the value of GL_FRAMEBUFFER_DEFAULT_SAMPLES is used for the framebuffer. param must be greater than or equal to zero and less than or equal to the value of GL_MAX_FRAMEBUFFER_SAMPLE.

GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS

param specifies whether the framebuffer should assume identical sample locations and the same number of samples for all texels in the virtual image. If param is zero, then the implementation may vary the position or the count of samples within the virtual image from pixel to pixel, otherwise it will use the same sample position and count for all pixels in the virtual image.

Errors

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

GL_INVALID_OPERATION is generated by glFramebufferParameteri if the default framebuffer is bound to target.

GL_INVALID_OPERATION is generated by glNamedFramebufferParameteri if framebuffer is not the name of an existing framebuffer object.

GL_INVALID_VALUE is generated if pname is GL_FRAMEBUFFER_DEFAULT_WIDTH and param is less than zero or greater than the value of GL_MAX_FRAMEBUFFER_WIDTH.

GL_INVALID_VALUE is generated if pname is GL_FRAMEBUFFER_DEFAULT_HEIGHT and param is less than zero or greater than the value of GL_MAX_FRAMEBUFFER_HEIGHT.

GL_INVALID_VALUE is generated if pname is GL_FRAMEBUFFER_DEFAULT_LAYERS and param is less than zero or greater than the value of GL_MAX_FRAMEBUFFER_LAYERS.

GL_INVALID_VALUE is generated if pname is GL_FRAMEBUFFER_DEFAULT_SAMPLES and param is less than zero or greater than the value of GL_MAX_FRAMEBUFFER_SAMPLES.

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
glFramebufferParameteri - - - - - - - - -
glNamedFramebufferParameteri - - - - - - - - - - -