glDepthMask function

The glDepthMask function enables or disables writing into the depth buffer.

Syntax


void WINAPI glDepthMask(
   GLboolean flag
);

Parameters

flag

Specifies whether the depth buffer is enabled for writing. If flag is zero, depth-buffer writing is disabled. Otherwise, it is enabled. Initially, depth-buffer writing is enabled.

Return value

This function does not return a value.

Error codes

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

NameMeaning
GL_INVALID_OPERATION

The function was called between a call to glBegin and the corresponding call to glEnd.

Error codes

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

NameMeaning
GL_INVALID_OPERATION

The function was called between a call to glBegin and the corresponding call to glEnd.

Remarks

The following function retrieves information related to glDepthMask:

glGet with argument GL_DEPTH_WRITEMASK

Requirements

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
glColorMask
glDepthFunc
glDepthRange
glEnd
glGet
glIndexMask
glStencilMask

 

 

Show: