logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

glGetFramebufferParameteriv, glGetNamedFramebufferParameteriv - query a named parameter of a framebuffer

Associated Gets

glGetFramebufferAttachmentParameter()

C Specification

voidglGetFramebufferParameteriv(GLenumtarget,GLenumpname,GLint*params);voidglGetNamedFramebufferParameteriv(GLuintframebuffer,GLenumpname,GLint*param);

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_WIDTHparams returns the value of GL_FRAMEBUFFER_DEFAULT_WIDTH for the framebuffer object.

       GL_FRAMEBUFFER_DEFAULT_HEIGHTparams returns the value of GL_FRAMEBUFFER_DEFAULT_HEIGHT for the framebuffer object.

       GL_FRAMEBUFFER_DEFAULT_LAYERSparams returns the value of GL_FRAMEBUFFER_DEFAULT_LAYERS for the framebuffer object.

       GL_FRAMEBUFFER_DEFAULT_SAMPLESparams returns the value of GL_FRAMEBUFFER_DEFAULT_SAMPLES for the framebuffer object.

       GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONSparams 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_DOUBLEBUFFERparam returns a boolean value indicating whether double buffering is supported for the framebuffer
           object.

       GL_IMPLEMENTATION_COLOR_READ_FORMATparam returns a GLenum value indicating the preferred pixel data format for the framebuffer object.
           See glReadPixels().

       GL_IMPLEMENTATION_COLOR_READ_TYPEparam returns a GLenum value indicating the implementation's preferred pixel data type for the
           framebuffer object. See glReadPixels().

       GL_SAMPLESparam returns an integer value indicating the coverage mask size for the framebuffer object. See
           glSampleCoverage().

       GL_SAMPLE_BUFFERSparam returns an integer value indicating the number of sample buffers associated with the
           framebuffer object. See glSampleCoverage().

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

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.

Name

       glGetFramebufferParameteriv, glGetNamedFramebufferParameteriv - query a named parameter of a 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.

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.

See Also

glFramebufferParameteri(), glGetFramebufferAttachmentParameter()

Version Support

       ┌──────────────────────────────────┬───────────────────────────────────────────────────────────────────────┐
       │                                  │                OpenGLVersion                                         │
       ├──────────────────────────────────┼─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┤
       │ Function2.02.13.03.13.23.34.04.14.24.34.44.5 │
       │ /                                │     │     │     │     │     │     │     │     │     │     │     │     │
       │ Feature                          │     │     │     │     │     │     │     │     │     │     │     │     │
       │ Name                             │     │     │     │     │     │     │     │     │     │     │     │     │
       ├──────────────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
       │ glGetFramebufferParameteriv      │  -  │  -  │  -  │  -  │  -  │  -  │  -  │  -  │  -  │  ✔  │  ✔  │  ✔  │
       ├──────────────────────────────────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
       │ glGetNamedFramebufferParameteriv │  -  │  -  │  -  │  -  │  -  │  -  │  -  │  -  │  -  │  -  │  -  │  ✔  │
       └──────────────────────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘

See Also