glClearStencil

The glClearStencil function specifies the clear value for the stencil buffer.

void glClearStencil(
  GLint s   
);
 

Parameters

s
The index used when the stencil buffer is cleared. The default value is zero.

Remarks

The glClearStencil function specifies the index used by glClear to clear the stencil buffer. The s parameter is masked with 2^m – 1, where m is the number of bits in the stencil buffer.

The following functions retrieve information related to the glClearStencil function:

glGet with argument GL_STENCIL_CLEAR_VALUE

glGet with argument GL_STENCIL_BITS

Error Codes

The following are the error codes generated and their conditions.

Error Code Condition
GL_INVALID_OPERATION glClearStencil was called between a call to glBegin and the corresponding call to glEnd.

QuickInfo

  Windows NT: Use version 3.5 and later.
  Windows: Use Windows 95 and later.
  Windows CE: Unsupported.
  Header: Declared in gl.h.
  Import Library: Link with opengl32.lib.

See Also

glBegin, glClear, glEnd, glGet