GL_APICALL void GL_APIENTRY glClear(
GLbitfield mask
);
| Name | Description | |
|---|---|---|
| in | mask | Buffer-indication bits. |
Clears the various buffers attached to the current framebuffer.
Set mask to a bitwise OR of any of the following values.
| GL_COLOR_BUFFER_BIT | Clear the color buffer. |
|---|---|
| GL_DEPTH_BUFFER_BIT | Clear the depth buffer. |
| GL_STENCIL_BUFFER_BIT | Clear the stencil buffer. |
| GL_EARLY_DEPTH_BUFFER_BIT_DMP | Clear the early depth buffer. |
Because GL_DEPTH24_STENCIL8_EXT is the only supported stencil buffer format, if you specify GL_STENCIL_BUFFER_BIT you must also specify GL_DEPTH_BUFFER_BIT.
A value of GL_EARLY_DEPTH_BUFFER_BIT_DMP is used to clear the early depth buffer. You cannot configure the early depth buffer to be cleared from POD.
Scissoring set by glScissor and various buffer mask settings set by glColorMask, glDepthMask, and glStencilMask do not affect how the buffers are cleared by glClear. If a render buffer has not been set on the framebuffer's attachment point, clear operations are ignored.
This function generates the following errors.
| GL_INVALID_VALUE | The mask argument was set to an invalid value. |
|---|---|
| GL_INVALID_OPERATION | The mask argument specified GL_STENCIL_BUFFER_BIT without specifying GL_DEPTH_BUFFER_BIT. |
| GL_INVALID_OPERATION | This function was called without any command-list objects bound. |
CONFIDENTIAL