# glClear

Definition: | include pGUI.e include opengl.e glClear(integer mask)
Description: | The glClear function clears buffers to preset values. mask: Bitwise OR operators of masks that indicate the buffers to be cleared. The four masks are defined as follows in opengl.e:
                    GL_DEPTH_BUFFER_BIT     = #00000100, -- The depth buffer.
                    GL_ACCUM_BUFFER_BIT     = #00000200, -- The accumulation buffer.
                    GL_STENCIL_BUFFER_BIT   = #00000400, -- The stencil buffer.
                    GL_COLOR_BUFFER_BIT     = #00004000, -- The buffers currently enabled for color writing.
If mask is not one of the above values, glGetError() will return GL_INVALID_VALUE. If this routine is called between glBegin() and glEnd(), glGetError() will return GL_INVALID_OPERATION.
pwa/p2js: | Supported.
Remarks | The glClear function sets the bitplane area of the window to values previously selected by glClearColor, glClearIndex, glClearDepth, glClearStencil, and glClearAccum. You can clear multiple color buffers simultaneously by selecting more than one buffer at a time using glDrawBuffer. The pixel-ownership test, the scissor test, dithering, and the buffer writemasks affect the operation of glClear. The scissor box bounds the cleared region. The glClear function ignores the alpha function, blend function, logical operation, stenciling, texture mapping, and z-buffering. The glClear function takes a single argument (mask) that is the bitwise OR of several values indicating which buffer is to be cleared. 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, a glClear call directed at that buffer has no effect. The following functions retrieve information related to glClear: glGet with argument GL_ACCUM_CLEAR_VALUE glGet with argument GL_DEPTH_CLEAR_VALUE glGet with argument GL_INDEX_CLEAR_VALUE glGet with argument GL_COLOR_CLEAR_VALUE glGet with argument GL_STENCIL_CLEAR_VALUE
See Also: | glGetError, xor_bits, glGet, int_to_bits DEV See also glClearAccum glClearColor glClearDepth glClearIndex glClearStencil glDrawBuffer //glGet glScissor