glDepthFunc Function

Syntax

GL_APICALL void GL_APIENTRY glDepthFunc(
     GLenum func
);

Parameters

Name Description
in func Comparison function

Return Values

No values are returned.

Description

Specifies the comparison function to use for depth tests.

You can set func to the following values.

GL_NEVERThe depth test always fails.
GL_LESSPasses when the depth value of the fragment is less than the depth value in the depth buffer.
GL_EQUALPasses when the depth value of the fragment is equal to the depth value in the depth buffer.
GL_LEQUALPasses when the depth value of the fragment is less than or equal to the depth value in the depth buffer.
GL_GREATERPasses when the depth value of the fragment is greater than the depth value in the depth buffer.
GL_NOTEQUALPasses when the depth value of the fragment is not equal to the depth value in the depth buffer.
GL_GEQUALPasses when the depth value of the fragment is greater than or equal to the depth value in the depth buffer.
GL_ALWAYSThe depth test always passes.

This function generates the following errors.

GL_INVALID_ENUMThe func argument was set to an invalid value.
GL_INVALID_OPERATIONThis function was called without any command-list objects bound.

Revision History

2010/01/07
Initial version.

CONFIDENTIAL