Enables or disables a GL capability.
OpenGL C bindings library: libGL.a
void glEnable(GLenum capability)
void glDisable(GLenum capability)
capability | Specifies a symbolic constant indicating a GL capability. Initially, all are disabled except GL_DITHER. |
glEnable and glDisable enable and disable various capabilities. Use glIsEnable or glGet to determine the current setting of any capability. Both glEnable and glDisable take a single argument, capability, which may assume one of the following values:
GL_ALPHA_TEST | If enabled, do alpha testing. (See glAlphaFunc.) |
GL_AUTO_NORMAL | If enabled, compute surface normal vectors analytically when either GL_MAP2_VERTEX_3 or GL_MAP2_VERTEX_4 is used to generate vertices. (See glMap2.) |
GL_BLEND | If enabled, blend the incoming red, green, blue, alpha (RGBA) color values with the values in the color buffers. (See glBlendFunc.) |
GL_CLIP_PLANEi | If enabled, clip geometry against user-defined clipping plane i. (See glClipPlane.) |
GL_COLOR_ARRAY_EXT | If enabled, colors are taken from the color array when glArrayElementEXT or glDrawArraysEXT is called. (See glColorPointerEXT, glArrayElementEXT and glDrawArraysEXT.) |
GL_COLOR_LOGIC_OP | If enabled, apply the currently selected logical operation to the incoming color and color buffer values. The initial value is GL_FALSE. (See glLogicOp.) |
GL_COLOR_MATERIAL | If enabled, have one or more material parameters track the current color. (See glColorMaterial.) |
GL_CULL_FACE | If enabled, cull polygons based on their winding in window coordinates. (See glCullFace.) |
GL_CULL_VERTEX_IBM | If enabled, cull polygons based on their vertex normals. (See "GL_CULL_VERTEX_IBM".) |
GL_DEPTH_TEST | If enabled, do depth comparisons and update the depth buffer. (See glDepthFunc and glDepthRange.) |
GL_DITHER | If enabled, dither color components or indices before they are written to the color buffer. |
GL_EDGE_FLAG_ARRAY_EXT | If enabled, edge flags are taken from the edge flags array when glArrayElementEXT or glDrawArraysEXT is called. (See glEdgeFlagPointerEXT, glArrayElementEXT and glDrawArraysEXT.) |
GL_FOG | If enabled, blend a fog color into the post-texturing color. (See glFog.) |
GL_INDEX_ARRAY_EXT | If enabled, color indexes are taken from the color index array when glArrayElementEXT or glDrawArraysEXT is called. (See glIndexPointerEXT, glArrayElementEXT and glDrawArraysEXT.) |
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 or index. Otherwise, simply associate the current color or index 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_LINE_STIPPLE | If enabled, use the current line stipple pattern when drawing lines. (See glLineStipple.) |
GL_LOGIC_OP | If enabled, apply the currently selected logical operation to the incoming and color buffer indices. (See glLogicOp.) |
GL_MAP1_COLOR_4 | If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate RGBA values. (See glMap1.) |
GL_MAP1_INDEX | If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate color indices. (See glMap1.) |
GL_MAP1_NORMAL | If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate normals. (See glMap1.) |
GL_MAP1_TEXTURE_COORD_1 | If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate s texture coordinates. (See glMap1.) |
GL_MAP1_TEXTURE_COORD_2 | If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate s and t texture coordinates. (See glMap1.) |
GL_MAP1_TEXTURE_COORD_3 | If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate s, t, and r texture coordinates. (See glMap1.) |
GL_MAP1_TEXTURE_COORD_4 | If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate s, t, r, and q texture coordinates. (See glMap1.) |
GL_MAP1_VERTEX_3 | If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate will generate x, y, and z vertex coordinates. (See glMap1.) |
GL_MAP1_VERTEX_4 | If enabled, calls to glEvalCoord1, glEvalMesh1, and glEvalPoint1 will generate homogeneous x, y, z, and w vertex coordinates. (See glMap1.) |
GL_MAP2_COLOR_4 | If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate RGBA values. (See glMap2.) |
GL_MAP2_INDEX | If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate color indices. (See glMap2.) |
GL_MAP2_NORMAL | If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate normals. (See glMap2.) |
GL_MAP2_TEXTURE_COORD_1 | If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate s texture coordinates. (See glMap2.) |
GL_MAP2_TEXTURE_COORD_2 | If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate s and t texture coordinates. (See glMap2.) |
GL_MAP2_TEXTURE_COORD_3 | If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate s, t, and r texture coordinates. (See glMap2.) |
GL_MAP2_TEXTURE_COORD_4 | If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate s, t, r, and q texture coordinates. (See glMap2.) |
GL_MAP2_VERTEX_3 | If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate will generate x, y, and z vertex coordinates. (See glMap2.) |
GL_MAP2_VERTEX_4 | If enabled, calls to glEvalCoord2, glEvalMesh2, and glEvalPoint2 will generate homogeneous x, y, z, and w vertex coordinates. (See glMap2.) |
GL_NORMAL_ARRAY_EXT | If enabled, normals are taken from the normal array when glArrayElementEXT or glDrawArraysEXT is called. (See glNormalPointerEXT, glArrayElementEXT and glDrawArraysEXT.) |
GL_NORMALIZE | If enabled, normal vectors specified with glNormal are scaled to unit length after transformation. (See glNormal.) |
GL_POLYGON_OFFSET_EXT | If enabled, an offset is added to z values of a polygon's fragments before the depth comparison is performed. (See glPolygonOffsetEXT.) |
GL_POLYGON_OFFSET_FILL | If enabled, and if the polygon is rendered in GL_FILL mode, an offset is added to z values of a polygon's fragments before the depth comparison is performed. The initial value is GL_FALSE. (See glPolygonOffset.) |
GL_POLYGON_OFFSET_LINE | If enabled, and if the polygon is rendered in GL_LINE mode, an offset is added to z values of a polygon's fragments before the depth comparison is performed. The initial value is GL_FALSE. (See glPolygonOffset.) |
GL_POLYGON_OFFSET_POINT | If enabled, an offset is added to z values of a polygon's fragments before the depth comparison is performed, if the polygon is rendered in GL_POINT mode. The initial value is GL_FALSE. (See glPolygonOffset.) |
GL_POINT_SMOOTH | If enabled, draw points with proper filtering. Otherwise, draw aliased points. (See glPointSize.) |
GL_POLYGON_SMOOTH | If enabled, draw polygons with proper filtering. Otherwise, draw aliased polygons. (See glPolygonMode.) |
GL_POLYGON_STIPPLE | If enabled, use the current polygon stipple pattern when rendering polygons. (See glPolygonStipple.) |
GL_RESCALE_NORMAL_EXT | If normal rescaling is enabled, a new operation is added to the transformation of the normal vector into eye coordinates. The normal vector is rescaled after it is multiplied by the inverse modelview matrix and before it is normalized. |
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 and glStencilOp.) |
GL_TEXTURE_1D | If enabled, one-dimensional texturing is performed (unless two-dimensional texturing is also enabled). (See glTexImage1D.) |
GL_TEXTURE_2D | If enabled, two-dimensional texturing is performed. (See glTexImage2D.) |
GL_TEXTURE_3D_EXT | If enabled, three-dimensional texture mapping is performed. (See glTexImage3DEXT.) |
GL_TEXTURE_COORD_ARRAY_EXT | If enabled, texture coordinates are taken from the texture coordinates array when glArrayElementEXT or glDrawArraysEXT is called. (See glTexCoordPointerEXT, glArrayElementEXT and glDrawArraysEXT.) |
GL_TEXTURE_GEN_Q | If enabled, the q texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise the current q texture coordinate is used. (See glTexGen.) |
GL_TEXTURE_GEN_R | If enabled, the r texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise the current r texture coordinate is used. (See glTexGen.) |
GL_TEXTURE_GEN_S | If enabled, the s texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise the current s texture coordinate is used. (See glTexGen.) |
GL_TEXTURE_GEN_T | If enabled, the t texture coordinate is computed using the texture generation function defined with glTexGen. Otherwise, the current t texture coordinate is used. (See glTexGen.) |
GL_VERTEX_ARRAY_EXT | If enabled, vertexes are taken from the vertex array when glArrayElementEXT or glDrawArraysEXT is called. (See glVertexPointerEXT, glArrayElementEXT and glDrawArraysEXT.) |
When vertex culling is enabled, vertices are classified as front or back facing according to the sign of the dot product between the normal at the vertex and an eye direction vector from the vertex toward the eye position. When (normal dot eye_direction) <= 0 the vertex is classified as back facing. When (normal dot eye_direction) > 0 the vertex is classified as front facing. Vertices are culled when the face orientation determined by the dot product is the same as the face specified by CullFace. When all of the vertices of a polygon are culled, then the polygon may be culled. Unlike GL_CULL_VERTEX_EXT, vertex culling using GL_CULL_VERTEX_IBM does not necessarily result in polygons being culled even if all of the vertices of the polygon are culled.
The eye direction is determined by transforming the column vector (0, 0, 1) by the upper leftmost 3x3 matrix taken from the inverse of the modelview matrix. The eye direction is undefined if the modelview matrix is singular or nearly singular. This operation in effect projects the z axis in eye coordinates back into object space. If the projection matrix or DepthRange settings cause the z axis in window coordinates to be misaligned with the z axis in eye coordinates, this extension should not be used.
Vertex culling is performed independently of face culling. Polygons on the silhouettes of objects may have both front and back facing vertices. Since polygons are culled only if all of their vertices are culled and are not necessarily culled by GL_CULL_VERTEX_IBM even in that case, face culling may have to be used in addition to vertex culling in order to correctly cull silhouette polygons.
GL_INVALID_ENUM | capability is not an accepted value. |
GL_INVALID_OPERATION | The glEnable subroutine is called between a call to glBegin and the corresponding call to glEnd. |
/usr/include/GL/gl.h | Contains C language constants, variable type definitions, and ANSI function prototypes for OpenGL. |
The glAlphaFunc subroutine, glArrayElementEXT subroutine, glBegin or glEnd subroutine, glBlendFunc subroutine, glClipPlane subroutine, glColorMaterial subroutine, glColorPointerEXT subroutine, glCullFace subroutine, glDepthFunc subroutine, glDepthRange subroutine, glDrawArraysEXT subroutine, glEdgeFlagPointerEXT subroutine, glFog subroutine, glIndexPointerEXT subroutine, glIsEnabled subroutine, glLight subroutine, glLightModel subroutine, glLineStipple subroutine, glLineWidth subroutine, glLogicOp subroutine, glMap1 subroutine, glMap2 subroutine, glMaterial subroutine, glNormal subroutine, glNormalPointerEXT subroutine, glPointSize subroutine, glPolygonMode subroutine, glPolygonOffset subroutine, glPolygonOffsetEXT subroutine, glPolygonStipple subroutine, glScissor subroutine, glTexCoordPointerEXT subroutine, glTexGen subroutine, glTexImage1D subroutine, glTexImage2D subroutine, glTexImage3DEXT subroutine.