Name

glEnable , glDisable - enable or disable server-side GL capabilities

C Specification

void glEnable(GLenum cap)
void glDisable(GLenum cap)

Parameters

cap

Specifies a symbolic constant indicating a GL capability.

Description

glEnable and glDisable enable and disable various capabilities. The initial value for each capability with the exception of GL_DITHER and GL_MULTISAMPLE is GL_FALSE. The initial value for GL_DITHER and GL_MULTISAMPLE is GL_TRUE.

Both glEnable and glDisable take a single argument, cap, which can assume one of the following values:

GL_ALPHA_TEST

If enabled, do alpha testing. See glAlphaFunc.

GL_BLEND

If enabled, blend the incoming color values with the values in the color buffers. See glBlendFunc.

GL_COLOR_LOGIC_OP

If enabled, apply the currently selected logical operation to the incoming color and color buffer values. See glLogicOp.

GL_COLOR_MATERIAL

If enabled, have ambient and diffuse material parameters track the current color.

GL_CULL_FACE

If enabled, cull polygons based on their winding in window coordinates. See glCullFace.

GL_DEPTH_TEST

If enabled, do depth comparisons and update the depth buffer. Note that even if the depth buffer exists and the depth mask is non-zero, the depth buffer is not updated if the depth test is disabled. See glDepthFunc, glDepthMask, and glDepthRange.

GL_DITHER

If enabled, dither color components or indices before they are written to the color buffer.

GL_FOG

If enabled, blend a fog color into the posttexturing color. See glFog.

GL_LIGHTi

If enabled, include light i in the evaluation of the lighting equation. See glLightModel and glLight.

GL_LIGHTING

If enabled, use the current lighting parameters to compute the vertex color. Otherwise, simply associate the current color with each vertex. See glMaterial, glLightModel, and glLight.

GL_LINE_SMOOTH

If enabled, draw lines with correct filtering. Otherwise, draw aliased lines. See glLineWidth.

GL_MULTISAMPLE

If enabled, perform multisampling of fragments for single-pass antialiasing and other effects. See glSampleCoverage.

GL_NORMALIZE

If enabled, normal vectors are scaled to unit length after transformation. See glNormal and glNormalPointer.

GL_POINT_SMOOTH

If enabled, draw points with proper filtering. Otherwise, draw aliased points. See glPointSize.

GL_POLYGON_OFFSET_FILL

If enabled, an offset is added to depth values of a polygon's fragments before the depth comparison is performed. See glPolygonOffset.

GL_RESCALE_NORMAL

If enabled, normal vectors are scaled by a factor derived from the modelview matrix. See glNormal and glNormalPointer.

GL_SAMPLE_ALPHA_TO_MASK

If enabled, convert fragment alpha values to multisample coverage modification masks. See glSampleCoverage.

GL_SAMPLE_ALPHA_TO_ONE

If enabled, set fragment alpha to the maximum permissible value after computing multisample coverage modification masks. See glSampleCoverage.

GL_SAMPLE_MASK

If enabled, apply a mask to modify fragment coverage during multisampling. See glSampleCoverage.

GL_SCISSOR_TEST

If enabled, discard fragments that are outside the scissor rectangle. See glScissor.

GL_STENCIL_TEST

If enabled, do stencil testing and update the stencil buffer. See glStencilFunc, glStencilMask, and glStencilOp.

GL_TEXTURE_2D

If enabled, two-dimensional texturing is performed for the active texture unit. See glActiveTexture, glTexImage2D, glCompressedTexImage2D, and glCopyTexImage2D.

Errors

GL_INVALID_ENUM is generated if cap is not one of the values listed previously.

Copyright

Copyright © 2003 Silicon Graphics, Inc.

This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/.

See Also

glActiveTexture, glAlphaFunc, glBlendFunc, glCompressedTexImage2D, glCopyTexImage2D, glCullFace, glDepthFunc, glDepthRange, glEnableClientState, glFog, glLight, glLightModel, glLineWidth, glLogicOp, glMaterial, glNormal, glPointSize, glPolygonOffset, glSampleCoverage, glScissor, glStencilFunc, glStencilOp, glTexImage2D