glEnable, glDisable

[New - Windows 95, OEM Service Release 2]

The glEnable and glDisable functions enable or disable OpenGL capabilities.

void glEnable(

    GLenum cap

 

   );

 

 

void glDisable(

    GLenum cap

 

   );

 

 

Parameters

cap

A symbolic constant indicating an OpenGL capability.

For discussion of the values cap can take, see the following Remarks section.

 

Remarks

The glEnable and glDisable functions enable and disable various capabilities. Use glIsEnabled1MZ_ZK. or glGet8KNKTW to determine the current setting of any capability.

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 glAlphaFunc3OLHFW4.

GL_AUTO_NORMAL

If enabled, compute surface normal vectors analytically when either GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4 has generated vertices. See glMap2E5BV.I.

GL_BLEND

If enabled, blend the incoming RGBA color values with the values in the color buffers. See glBlendFuncIXY.WO.

GL_CLIP_PLANEi

If enabled, clip geometry against user-defined clipping plane i. See glClipPlane6HCR6N.

GL_COLOR_MATERIAL

If enabled, have one or more material parameters track the current color. See glColorMaterial2U57YMP.

GL_CULL_FACE

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

GL_DEPTH_TEST

If enabled, do depth comparisons and update the depth buffer. See glDepthFuncC4GZX and glDepthRange1RRKZ50.

GL_DITHER

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

GL_FOG

If enabled, blend a fog color into the post-texturing color. See glFog8KNK3J.

GL_LIGHTi

If enabled, include light i in the evaluation of the lighting equation. See glLightModel21E1NBY and glLightOXNARM.

GL_LIGHTING

If enabled, use the current lighting parameters to compute the vertex color or index. If disabled, associate the current color or index with each vertex. See glMaterialECT15., glLightModel, and glLight.

GL_LINE_SMOOTH

If enabled, draw lines with correct filtering. If disabled, draw aliased lines. See glLineWidthD7DWCH.

GL_LINE_STIPPLE

If enabled, use the current line stipple pattern when drawing lines. See glLineStipple7PZ0SH.

GL_LOGIC_OP

If enabled, apply the currently selected logical operation to the incoming and color-buffer indexes. See glLogicOpN__P0P.

GL_MAP1_COLOR_4

If enabled, calls to glEvalCoord1JY1DQM, glEvalMesh116GNURM, and glEvalPoint11ZMI_QR generate RGBA values. See also glMap1E5BV.H.

GL_MAP1_INDEX

If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate color indexes. See also glMap1.

GL_MAP1_NORMAL

If enabled, calls to glEvalCoord1JY1DQM, glEvalMesh116GNURM, and glEvalPoint11ZMI_QR generate normals. See also glMap1E5BV.H.

GL_MAP1_TEXTURE_COORD_1

If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate s texture coordinates. See also glMap1.

GL_MAP1_TEXTURE_COORD_2

If enabled, calls to glEvalCoord1JY1DQM, glEvalMesh116GNURM, and glEvalPoint11ZMI_QR generate s and t texture coordinates. See also glMap1E5BV.H.

GL_MAP1_TEXTURE_COORD_3

If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate s, t, and r texture coordinates. See also glMap1.

GL_MAP1_TEXTURE_COORD_4

If enabled, calls to glEvalCoord1JY1DQM, glEvalMesh116GNURM, and glEvalPoint11ZMI_QR generate s, t, r, and q texture coordinates. See also glMap1E5BV.H.

GL_MAP1_VERTEX_3

If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate x, y, and z vertex coordinates. See also glMap1.

GL_MAP1_VERTEX_4

If enabled, calls to glEvalCoord1JY1DQM, glEvalMesh116GNURM, and glEvalPoint11ZMI_QR generate homogeneous x, y, z, and w vertex coordinates. See also glMap1E5BV.H.

GL_MAP2_COLOR_4

If enabled, calls to glEvalCoord2JY1DQM, glEvalMesh216GNURM, and glEvalPoint21ZMI_QR generate RGBA values. See also glMap2E5BV.I.

GL_MAP2_INDEX

If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate color indexes. See also glMap2.

GL_MAP2_NORMAL

If enabled, calls to glEvalCoord2JY1DQM, glEvalMesh216GNURM, and glEvalPoint21ZMI_QR generate normals. See also glMap2E5BV.I.

GL_MAP2_TEXTURE_COORD_1

If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate s texture coordinates. See also glMap2.

GL_MAP2_TEXTURE_COORD_2

If enabled, calls to glEvalCoord2JY1DQM, glEvalMesh216GNURM, and glEvalPoint21ZMI_QR generate s and t texture coordinates. See also glMap2E5BV.I.

GL_MAP2_TEXTURE_COORD_3

If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate s, t, and r texture coordinates. See also glMap2.

GL_MAP2_TEXTURE_COORD_4

If enabled, calls to glEvalCoord2JY1DQM, glEvalMesh216GNURM, and glEvalPoint21ZMI_QR generate s, t, r, and q texture coordinates. See also glMap2E5BV.I.

GL_MAP2_VERTEX_3

If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate x, y, and z vertex coordinates. See also glMap2.

GL_MAP2_VERTEX_4

If enabled, calls to glEvalCoord2JY1DQM, glEvalMesh216GNURM, and glEvalPoint21ZMI_QR generate homogeneous x, y, z, and w vertex coordinates. See also glMap2E5BV.I.

GL_NORMALIZE

If enabled, normal vectors specified with glNormal are scaled to unit length after transformation. See glNormal2NHAN7.

GL_POINT_SMOOTH

If enabled, draw points with proper filtering. If disabled, draw aliased points. See glPointSizeHQOGCD.

GL_POLYGON_SMOOTH

If enabled, draw polygons with proper filtering. If disabled, draw aliased polygons. See glPolygonMode1OYC7V5.

GL_POLYGON_STIPPLE

If enabled, use the current polygon stipple pattern when rendering polygons. See glPolygonStipple1N7CB5B.

GL_SCISSOR_TEST

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

GL_STENCIL_TEST

If enabled, do stencil testing and update the stencil buffer. See glStencilFunc1NSO64P and glStencilOp1N11GRZ.

GL_TEXTURE_1D

If enabled, one-dimensional texturing is performed (unless two-dimensional texturing is also enabled). See glTexImage1D1HIX0MK.

GL_TEXTURE_2D

If enabled, two-dimensional texturing is performed. See glTexImage2D1HIX0NK.

GL_TEXTURE_GEN_Q

If enabled, the q texture coordinate is computed using the texture-generation function defined with glTexGen3IH49F3. Otherwise, the current q texture coordinate is used. 

GL_TEXTURE_GEN_R

If enabled, the r texture coordinate is computed using the texture generation function defined with glTexGen3IH49F3. If disabled, the current r texture coordinate is used. 

GL_TEXTURE_GEN_S

If enabled, the s texture coordinate is computed using the texture generation function defined with glTexGen. If disabled, the current s texture coordinate is used. 

GL_TEXTURE_GEN_T

If enabled, the t texture coordinate is computed using the texture generation function defined with glTexGen3IH49F3. If disabled, the current t texture coordinate is used. 

 

Error Codes

The following are the error codes generated and their conditions.

Error Code

Condition

GL_INVALID_ENUM

cap was not one of the values listed in the preceding Remarks section.

GL_INVALID_OPERATION

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

 

See Also

glAlphaFunc, glArrayElement, glBegin, glBlendFunc, glClipPlane, glColorMaterial, glColorPointer, glCullFace, glDepthFunc, glDepthRange, glDrawArrays, glEdgeFlagPointer, glEnd, glEvalCoord1, glEvalMesh1, glEvalPoint1, glFog, glGet, glIndexPointer, glIsEnabled, glLight, glLightModel, glLineWidth, glLineStipple, glLogicOp, glMap1, glMap2, glMaterial, glNormal, glNormalPointer, glPointSize, glPolygonMode, glPolygonStipple, glScissor, glStencilFunc, glStencilOp, glTexCoordPointer, glTexGen, glTexImage1D, glTexImage2D