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_CLIP_PLANEi

If enabled, clipping plane i is enabled. See glClipPlane.

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_MATRIX_PALETTE_OES

If enabled, the matrix palette extension is enabled. See glMatrixMode.

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_POINT_SPRITE_OES

If enabled, point sprites are enabled. See glPointSize and glTexEnv

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_COVERAGE

If enabled, a temporary coverage value is generated where each bit is determined by the alpha value at the corresponding sample location. The temporary coverage value is then ANDed with the fragment coverage value. Otherwise the fragment coverage value is unchanged at this point. See glSampleCoverage.

GL_SAMPLE_ALPHA_TO_ONE

If enabled, each fragment alpha value is replaced by the maximum representable alpha value. Otherwise, the alpha values are not changed. See glSampleCoverage.

GL_SAMPLE_COVERAGE

If enabled, the fragment coverage is ANDed with another temporary coverage. This temporary coverage is generated in the same manner as for GL_SAMPLE_ALPHA_TO_COVERAGE described above, but as a function of the value of GL_SAMPLE_COVERAGE_VALUE. If GL_SAMPLE_COVERAGE_INVERT is GL_TRUE, the temporary coverage is inverted (all bit values are inverted) before it is ANDed with the fragment coverage. 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-2004 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