2005 Sams Publishing

glGetFramebufferAttachmentParameteriv

3G

glGetFramebufferAttachmentParameteriv

return attachment parameters of a framebuffer object

# C Specification

                    void glGetFramebufferAttachmentParameteriv
                    GLenum target
                    GLenum attachment
                    GLenum pname
                    GLint * params

## Parameters

`target`

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

`attachment`

- Specifies the symbolic name of a framebuffer object attachment point. Accepted values are `GL_COLOR_ATTACHMENT0`, `GL_DEPTH_ATTACHMENT`, and `GL_STENCIL_ATTACHMENT`.

`pname`

- Specifies the symbolic name of a framebuffer object attachment parameter. Accepted values are `GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE`, `GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME`, `GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL`, and `GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE`.

`params`

- Returns the requested parameter.

## Description

`glGetFramebufferAttachmentParameteriv` returns in `params` a selected attachment parameter of the attachpoint point `attachment` of the currently bound framebuffer object.

`pname` names a specific framebuffer object attachment parameter, as follows:

`GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE`

- `params` returns the type of object which contains the attached image, either `GL_RENDERBUFFER`, `GL_TEXTURE`, or if no image is attached, `GL_NONE`. The initial value is `GL_NONE`.

`GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME`

- If the value of `GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE` is `GL_RENDERBUFFER`, `params` returns the name of the renderbuffer object which contains the attached image. If the value of `GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE` is `GL_TEXTURE`, `params` returns the name of the texture object which contains the attached image. The initial value is zero.

`GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL`

- If the value of `GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE` is `GL_TEXTURE`, `params` returns the mipmap level of the texture object which contains the attached image. The initial value is zero.

`GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE`

- If the value of `GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE` is `GL_TEXTURE` and `GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME` is the name of a cube-map texture, `params` returns the cube map face of the cube-map texture object which contains the attached image. If the attached image is from a texture object but not a cube-map, `params` returns 0. The initial value is `GL_TEXTURE_CUBE_MAP_POSITIVE_X`.

## Notes

If an error is generated, no change is made to the contents of `params`.

## Errors

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

`GL_INVALID_ENUM` is generated if `attachment` is not `GL_COLOR_ATTACHMENT0`, `GL_DEPTH_ATTACHMENT`, or `GL_STENCIL_ATTACHMENT`.

`GL_INVALID_ENUM` is generated if the attached object at the named attachment point is `GL_RENDERBUFFER` and `pname` is not `GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE` or `GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME`.

`GL_INVALID_ENUM` is generated if the attached object at the named attachment point is `GL_TEXTURE` and `pname` is not `GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE`, `GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME`, `GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL`, or `GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE`.

`GL_INVALID_ENUM` is generated if there is no attached object at the named attachment point and `pname` is not `GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE`.

`GL_INVALID_OPERATION` is generated if the default framebuffer object name 0 is bound.

## See Also

glBindFramebuffer

,

glFramebufferRenderbuffer

,

glFramebufferTexture2D

## 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/.