Export (0) Print
Expand All
Expand Minimize
1 out of 1 rated this helpful - Rate this topic

glEnable function

Applies to: desktop apps only

The glEnable and glDisable functions enable or disable OpenGL capabilities.

Syntax

void WINAPI glEnable(
  GLenum cap
);

Parameters

cap

A symbolic constant indicating an OpenGL capability.

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

Return value

This function does not return a value.

Error codes

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

NameMeaning
GL_INVALID_ENUM

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

GL_INVALID_OPERATION

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

Remarks

The glEnable and glDisable functions enable and disable various OpenGL graphics capabilities. Use glIsEnabled or glGet 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:

ValueMeaning
GL_ALPHA_TESTIf enabled, do alpha testing. See glAlphaFunc.
GL_AUTO_NORMALIf enabled, compute surface normal vectors analytically when either GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4 has generated vertices. See glMap2.
GL_BLENDIf enabled, blend the incoming RGBA color values with the values in the color buffers. See glBlendFunc.
GL_CLIP_PLANEiIf enabled, clip geometry against user-defined clipping plane i. See glClipPlane.
GL_COLOR_LOGIC_OPIf enabled, apply the current logical operation to the incoming RGBA color and color buffer values. See glLogicOp.
GL_COLOR_MATERIALIf enabled, have one or more material parameters track the current color. See glColorMaterial.
GL_CULL_FACEIf enabled, cull polygons based on their winding in window coordinates. See glCullFace.
GL_DEPTH_TESTIf enabled, do depth comparisons and update the depth buffer. See glDepthFunc and glDepthRange.
GL_DITHERIf enabled, dither color components or indexes before they are written to the color buffer.
GL_FOGIf enabled, blend a fog color into the post-texturing color. See glFog.
GL_INDEX_LOGIC_OPIf enabled, apply the current logical operation to the incoming index and color buffer indices. See glLogicOp.
GL_LIGHTiIf enabled, include light i in the evaluation of the lighting equation. See glLightModel and glLight.
GL_LIGHTINGIf 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 glMaterial, glLightModel, and glLight.
GL_LINE_SMOOTHIf enabled, draw lines with correct filtering. If disabled, draw aliased lines. See glLineWidth.
GL_LINE_STIPPLEIf enabled, use the current line stipple pattern when drawing lines. See glLineStipple.
GL_LOGIC_OPIf enabled, apply the currently selected logical operation to the incoming and color-buffer indexes. See glLogicOp.
GL_MAP1_COLOR_4If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate RGBA values. See also glMap1.
GL_MAP1_INDEXIf enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate color indexes. See also glMap1.
GL_MAP1_NORMALIf enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate normals. See also glMap1.
GL_MAP1_TEXTURE_COORD_1If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate s texture coordinates. See also glMap1.
GL_MAP1_TEXTURE_COORD_2If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate s and t texture coordinates. See also glMap1.
GL_MAP1_TEXTURE_COORD_3If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate s, t, and r texture coordinates. See also glMap1.
GL_MAP1_TEXTURE_COORD_4If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate s, t, r, and q texture coordinates. See also glMap1.
GL_MAP1_VERTEX_3If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate x, y, and z vertex coordinates. See also glMap1.
GL_MAP1_VERTEX_4If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 generate homogeneous x, y, z, and w vertex coordinates. See also glMap1.
GL_MAP2_COLOR_4If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate RGBA values. See also glMap2.
GL_MAP2_INDEXIf enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate color indexes. See also glMap2.
GL_MAP2_NORMALIf enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate normals. See also glMap2.
GL_MAP2_TEXTURE_COORD_1If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate s texture coordinates. See also glMap2.
GL_MAP2_TEXTURE_COORD_2If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate s and t texture coordinates. See also glMap2.
GL_MAP2_TEXTURE_COORD_3If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate s, t, and r texture coordinates. See also glMap2.
GL_MAP2_TEXTURE_COORD_4If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate s, t, r, and q texture coordinates. See also glMap2.
GL_MAP2_VERTEX_3If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate x, y, and z vertex coordinates. See also glMap2.
GL_MAP2_VERTEX_4If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 generate homogeneous x, y, z, and w vertex coordinates. See also glMap2.
GL_NORMALIZEIf enabled, normal vectors specified with glNormal are scaled to unit length after transformation. See glNormal.
GL_POINT_SMOOTHIf enabled, draw points with proper filtering. If disabled, draw aliased points. See glPointSize.
GL_POLYGON_OFFSET_FILLIf enabled, and if the polygon is rendered in GL_FILL mode, an offset is added to depth values of a polygon's fragments before the depth comparison is performed. See glPolygonOffset.
GL_POLYGON_OFFSET_LINEIf enabled, and if the polygon is rendered in GL_LINE mode, an offset is added to depth values of a polygon's fragments before the depth comparison is performed. See glPolygonOffset.
GL_POLYGON_OFFSET_POINTIf enabled, an offset is added to depth values of a polygon's fragments before the depth comparison is performed, if the polygon is rendered in GL_POINT mode. See glPolygonOffset.
GL_POLYGON_SMOOTHIf enabled, draw polygons with proper filtering. If disabled, draw aliased polygons. See glPolygonMode.
GL_POLYGON_STIPPLEIf enabled, use the current polygon stipple pattern when rendering polygons. See glPolygonStipple.
GL_SCISSOR_TESTIf enabled, discard fragments that are outside the scissor rectangle. See glScissor.
GL_STENCIL_TESTIf enabled, do stencil testing and update the stencil buffer. See glStencilFunc and glStencilOp.
GL_TEXTURE_1DIf enabled, one-dimensional texturing is performed (unless two-dimensional texturing is also enabled). See glTexImage1D.
GL_TEXTURE_2DIf enabled, two-dimensional texturing is performed. See glTexImage2D.
GL_TEXTURE_GEN_QIf enabled, the q texture coordinate is computed using the texture-generation function defined with glTexGen. Otherwise, the current q texture coordinate is used.
GL_TEXTURE_GEN_RIf enabled, the r texture coordinate is computed using the texture generation function defined with glTexGen. If disabled, the current r texture coordinate is used.
GL_TEXTURE_GEN_SIf 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_TIf enabled, the t texture coordinate is computed using the texture generation function defined with glTexGen. If disabled, the current t texture coordinate is used.

 

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Gl.h

Library

Opengl32.lib

DLL

Opengl32.dll

See also

glAlphaFunc
glArrayElement
glBegin
glBlendFunc
glClipPlane
glColorMaterial
glColorPointer
glCullFace
glDepthFunc
glDepthRange
glDisable
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

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.