glCullFace function

The glCullFace function specifies whether front-facing or back-facing facets can be culled.

Syntax

void WINAPI glCullFace(
   GLenum mode
);

Parameters

mode

Specifies whether front-facing or back-facing facets are candidates for culling. The symbolic constants GL_FRONT, GL_BACK, and GL_FRONT_AND_BACK are accepted. The default value is GL_BACK.

Return value

This function does not return a value.

Error codes

The following error codes can be retrieved by the glGetError function.

Name Meaning
GL_INVALID_ENUM
mode was not an accepted value.
GL_INVALID_OPERATION
The function was called between a call to glBegin and the corresponding call to glEnd.

Remarks

The glCullFace function specifies whether front-facing or back-facing facets are culled (as specified by mode) when facet culling is enabled. You enable and disable facet culling using glEnable and glDisable with the argument GL_CULL_FACE. Facets include triangles, quadrilaterals, polygons, and rectangles.

The glFrontFace function specifies which of the clockwise and counterclockwise facets are front-facing and back-facing.

If mode is GL_FRONT_AND_BACK, no facets are drawn, but other primitives, such as points and lines, are drawn.

The following functions retrieve information related to glCullFace:

glGet with argument GL_CULL_FACE_MODE

glIsEnabled with argument GL_CULL_FACE

Requirements

Requirement Value
Minimum supported client
Windows 2000 Professional [desktop apps only]
Minimum supported server
Windows 2000 Server [desktop apps only]
Header
Gl.h
Library
Opengl32.lib
DLL
Opengl32.dll

See also

glBegin

glDisable

glEnable

glEnd

glFrontFace

glGet

glIsEnabled