Graphics Reference
In-Depth Information
The attachment point's state will be modified to
• Object type =
GL_RENDERBUFFER
• Object name =
renderbuffer
• Texture level and texture layer = 0
• Texture cubemap face =
GL_NONE
The newly attached renderbuffer object's state or contents of its buffer do
not change.
If
glFramebufferRenderbuffer
is called with
renderbuffer
equal to
zero, then the color, depth, or stencil buffer as specified by
attachment
is
detached and reset to zero.
The
glFramebufferTexture2D
command is used to attach a mip level of
a 2D texture or a cubemap face to a framebuffer attachment point. It can
be used to attach a texture as a color, depth, or stencil attachment.
void
glFramebufferTexture2D
(GLenum
target
,
GLenum
attachment
,
GLenum
textarget
,
GLuint
texture
,
Glint
level
)
target
must be set to
GL_READ_FRAMEBUFFER
,
GL_DRAW_FRAMEBUFFER
, or
GL_FRAMEBUFFER
attachment
must be one of the following enums:
GL_COLOR_ATTACHMENTi
GL_DEPTH_ATTACHMENT
GL_STENCIL_ATTACHMENT
GL_DEPTH_STENCIL_ATTACHMENT
textarget
specifies the texture target; this is the
value specified in the
target
argument in
glTexImage2D
texture
specifies the texture object
level
specifies the mip level of texture image