glClearDepth

The glClearDepth function specifies the clear value for the depth buffer.

void glClearDepth(
  GLclampd depth   
);
 

Parameters

depth
The depth value used when the depth buffer is cleared.

Remarks

The glClearDepth function specifies the depth value used by glClear to clear the depth buffer. Values specified by glClearDepth are clamped to the range [0,1].

The following function retrieves information related to the glClearDepth function:

glGet with argument GL_DEPTH_CLEAR_VALUE

Error Codes

The following are the error codes generated and their conditions.

Error Code Condition
GL_INVALID_OPERATION glClearDepth 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