/ comp / gb.opengl / gl / clear
Gl.Clear (gb.opengl)
Syntax

    STATIC SUB Clear ( Mask AS Integer )

### Clear buffers within the viewport

#### Parmeters

- Mask Bitwise OR of masks that indicate the buffers to be cleared. The four masks are Gl.GL_COLOR_BUFFER_BIT, Gl.GL_DEPTH_BUFFER_BIT, Gl.GL_ACCUM_BUFFER_BIT, and Gl.GL_STENCIL_BUFFER_BIT.

#### Description

Gl.Clear sets the bitplane area of the window to values previously selected by Gl.ClearColor, Gl.ClearIndex, Gl.ClearDepth, Gl.ClearStencil, and Gl.ClearAccum. Multiple color buffers can be cleared simultaneously by selecting more than one buffer at a time using Gl.DrawBuffer.

The pixel ownership test, the scissor test, dithering, and the buffer writemasks affect the operation of

Gl.Clear takes a single argument that is the bitwise OR of several values indicating which buffer is to be cleared. The values are as follows:

- Gl.GL_COLOR_BUFFER_BIT indicates the buffers currently enabled for color writing.

- Gl.GL_DEPTH_BUFFER_BIT indicates the depth buffer.

- Gl.GL_ACCUM_BUFFER_BIT indicates the accumulation buffer.

- Gl.GL_STENCIL_BUFFER_BIT indicates the stencil buffer.

The value to which each buffer is cleared depends on the setting of the clear value for that buffer.

| If a buffer is not present, then a Gl.Clear directed at that buffer has no effect.

#### Associated Gets

Gl.GetAccumClearValue
Gl.GetDepthClearValue
Gl.GetIndexClearValue
Gl.GetColorClearValue
Gl.GetStencilClearValue

### See also

Gl.ClearAccum , Gl.ClearColor , Gl.ClearDepth , Gl.ClearIndex , Gl.ClearStencil , Gl.DrawBuffer, Gl.Scissor