glEnable, glDisable
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. Use glIsEnabled or
glGet to determine the
current setting of any capability. The initial value for
each capability with the exceptions of GL_DITHER and GL_MULTISAMPLE_EXT
is GL_FALSE. The initial value for GL_DITHER and for GL_MULTISAMPLE_EXT
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_AUTO_NORMAL
-
If enabled, generate normal vectors
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 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_LOGIC_OP
-
If enabled, apply the currently
selected logical operation to the
incoming RGBA color and color
buffer values. See glLogicOp.
- GL_COLOR_MATERIAL
-
If enabled, have one or more
material parameters track the
current color. See
glColorMaterial.
- GL_COLOR_TABLE_EXT
-
If enabled, color image components are mapped through the color table that
resides before convolution. See glColorTableEXT.
- GL_CONVOLUTION_1D_EXT
-
If enabled, one-dimensional convolution will be
performed during pixel transfers.
See glConvolutionFilter1DEXT.
- GL_CONVOLUTION_2D_EXT
-
If enabled, two-dimensional convolution will be
performed during pixel transfers.
See glConvolutionFilter2DEXT.
- 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 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 post-texturing color. See
glFog.
- GL_FOG_OFFSET_EXT
-
If enabled, an offset is applied to the z value used
for computing fog. See glFog.
- GL_INDEX_LOGIC_OP
-
If enabled, apply the currently
selected logical operation to the
incoming index and color buffer
indices. See glLogicOp.
- GL_INTERLACE_EXT
-
If enabled, an image is considered to be interlaced. Each row m of the image
is treated as if it were row 2 * m. If the source image has a height
of h rows, this effectively expands the height of the image to
2 * h - 1. Where errors can result from the specification of invalid
image dimensions (e.g., glTexImage2D), it is the resulting
dimensions that are tested, not the dimensions of the source image. This enable has no
affect on image reads (see GL_INTERLACE_READ_I3D).
- GL_INTERLACE_READ_I3D
-
If enabled, an image in the frame buffer is considered to be interlaced.
Each row m of the image is treated as if it were row 2 * m.
If the frame buffer image has a height of h rows, this effectively expands the
height of the image to 2 * h - 1. This enable only affect
glReadPixels and glCopyPixels.
- 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_MAP1_COLOR_4
-
If enabled, calls to glEvalCoord1,
glEvalMesh1, and glEvalPoint1
generate RGBA values. See glMap1.
- GL_MAP1_INDEX
-
If enabled, calls to glEvalCoord1,
glEvalMesh1, and glEvalPoint1
generate color indices. See
glMap1.
- GL_MAP1_NORMAL
-
If enabled, calls to glEvalCoord1,
glEvalMesh1, and glEvalPoint1
generate normals. See glMap1.
- GL_MAP1_TEXTURE_COORD_1
-
If enabled, calls to glEvalCoord1,
glEvalMesh1, and glEvalPoint1
generate s texture coordinates.
See glMap1.
- GL_MAP1_TEXTURE_COORD_2
-
If enabled, calls to glEvalCoord1,
glEvalMesh1, and glEvalPoint1
generate s and t texture
coordinates. See glMap1.
- GL_MAP1_TEXTURE_COORD_3
-
If enabled, calls to glEvalCoord1,
glEvalMesh1, and glEvalPoint1
generate s, t, and r texture
coordinates. See glMap1.
- GL_MAP1_TEXTURE_COORD_4
-
If enabled, calls to glEvalCoord1,
glEvalMesh1, and glEvalPoint1
generate s, t, r, and q texture
coordinates. See glMap1.
- GL_MAP1_VERTEX_3
-
If enabled, calls to glEvalCoord1,
glEvalMesh1, and glEvalPoint1
generate x, y, and z vertex
coordinates. See glMap1.
- GL_MAP1_VERTEX_4
-
If enabled, calls to glEvalCoord1,
glEvalMesh1, and glEvalPoint1
generate homogeneous x, y, z, and w
vertex coordinates. See glMap1.
- GL_MAP2_COLOR_4
-
If enabled, calls to glEvalCoord2,
glEvalMesh2, and glEvalPoint2
generate RGBA values. See glMap2.
- GL_MAP2_INDEX
-
If enabled, calls to glEvalCoord2,
glEvalMesh2, and glEvalPoint2
generate color indices. See glMap2.
- GL_MAP2_NORMAL
-
If enabled, calls to glEvalCoord2,
glEvalMesh2, and glEvalPoint2
generate normals. See glMap2.
- GL_MAP2_TEXTURE_COORD_1
-
If enabled, calls to glEvalCoord2,
glEvalMesh2, and glEvalPoint2
generate s texture coordinates.
See glMap2.
- GL_MAP2_TEXTURE_COORD_2
-
If enabled, calls to glEvalCoord2,
glEvalMesh2, and glEvalPoint2
generate s and t texture
coordinates. See glMap2.
- GL_MAP2_TEXTURE_COORD_3
-
If enabled, calls to glEvalCoord2,
glEvalMesh2, and glEvalPoint2
generate s, t, and r texture
coordinates. See glMap2.
- GL_MAP2_TEXTURE_COORD_4
-
If enabled, calls to glEvalCoord2,
glEvalMesh2, and glEvalPoint2
generate s, t, r, and q texture
coordinates. See glMap2.
- GL_MAP2_VERTEX_3
-
If enabled, calls to glEvalCoord2,
glEvalMesh2, and glEvalPoint2
generate x, y, and z vertex
coordinates. See glMap2.
- GL_MAP2_VERTEX_4
-
If enabled, calls to glEvalCoord2,
glEvalMesh2, and glEvalPoint2
generate homogeneous x, y, z, and w
vertex coordinates. See glMap2.
- GL_MULTISAMPLE_EXT
-
If enabled, each pixel in the frame buffer has GL_SAMPLES_EXT
sample points associated with it.
- GL_NORMALIZE
-
If enabled, normal vectors
specified with glNormal are scaled
to unit length after
transformation. See glNormal.
- GL_OCCLUSION_TEST_EXT
-
If enabled, the occlusion state is updated based on the
depth test passing (see glDepthFunc).
The occlusion state can be read with glGetBooleanv.
- GL_PIXEL_TEX_GEN_EXT
-
If enabled, the image RGBA color is used as the texture coordinates for
the fragment. See glPixelTexGenEXT.
- GL_POINT_SMOOTH
-
If enabled, draw points with proper
filtering. Otherwise, draw aliased
points. See glPointSize.
- GL_POLYGON_OFFSET_FILL
-
If 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_LINE
-
If 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_POINT
-
If 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_SMOOTH
-
If enabled, draw polygons with
proper filtering. Otherwise, draw
aliased polygons. For correct
anti-aliased polygons, an alpha
buffer is needed and the polygons
must be sorted front to back.
- GL_POLYGON_STIPPLE
-
If enabled, use the current polygon
stipple pattern when rendering
polygons. See glPolygonStipple.
- GL_POST_COLOR_MATRIX_COLOR_TABLE_EXT
-
If enabled, color image components are mapped through the color table that
resides after the color matrix. See glColorTableEXT.
- GL_POST_CONVOLUTION_COLOR_TABLE_EXT
-
If enabled, color image components are mapped through the color table that
resides after convolution and before the color matrix. See
glColorTableEXT.
- GL_RESCALE_NORMAL_EXT
-
If enabled, the normal vector is multiplied by a rescale factor after it is
transformed into eye space and before it is normalized. The rescale factor is
calculated from the topmost row of the inverse transpose of the modelview matrix.
- GL_SAMPLE_ALPHA_TO_MASK_EXT
-
If enabled, the fragment alpha value is used to generate a temporary
mask value, which is then ANDed with the fragment mask value.
- GL_SAMPLE_ALPHA_TO_ONE_EXT
-
If enabled, fragment alpha is replaced by the maximum representable
alpha value.
- GL_SAMPLE_MASK_EXT
-
If enabled, the value of GL_SAMPLE_MASK_VALUE_EXT is used to generate
a temporary mask value, which is then ANDed with the fragment mask value.
- GL_SCISSOR_TEST
-
If enabled, discard fragments that
are outside the scissor rectangle.
See glScissor.
- GL_SEPARABLE_2D_EXT
-
If enable and GL_CONVOLUTION_2D_EXT is disable,
two-dimensional convolution using the separable filter will be
performed during pixel transfers.
See glSeparableFilter2DEXT.
- 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 (unless
three-dimensional texturing is also
enabled). See glTexImage2D.
- GL_TEXTURE_3D_EXT
-
If enabled, three-dimensional
texturing is performed.
See glTexImage3DEXT.
- GL_TEXTURE_COLOR_TABLE_EXT
-
If enabled, the filtered texture color is mapped
through the texture color table before the environment
blending with the fragment color. See
glColorTableEXT.
- 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.
EXTENSIONS
Some routines and constants for this function are part of an extension, not part of the
core GL command set. The following extension names must be present in the string returned by
glGetString when called with argument GL_EXTENSIONS
to use these routines and constants.
- GL_EXT_color_table
-
GL_COLOR_TABLE_EXT, GL_POST_CONVOLUTION_COLOR_TABLE_EXT,
and GL_POST_COLOR_MATRIX_COLOR_TABLE_EXT
are part of the EXT_color_table extension.
- GL_EXT_convolution
-
GL_CONVOLUTION_1D_EXT, GL_CONVOLUTION_2D_EXT, and GL_SEPARABLE_2D_EXT
are part of the EXT_convolution extension.
- GL_EXT_fog_offset
-
GL_FOG_OFFSET_EXT
is part of the EXT_fog_offset extension.
- EXT_interlace
-
GL_INTERLACE_EXT
is part of the EXT_interlace extension.
- EXT_interlace_read
- GL_INTERLACE_READ_I3D is part of the EXT_interlace_read
extension.
- GL_EXT_multisample
-
GL_MULTISAMPLE_EXT, GL_SAMPLE_ALPHA_TO_MASK_EXT,
GL_SAMPLE_ALPHA_TO_ONE_EXT, and GL_SAMPLE_MASK_EXT
are part of the EXT_multisample extension.
- GL_EXT_occlusion_test
-
GL_OCCLUSION_TEST_EXT
is part of the EXT_occlusion_test extension.
- GL_EXT_pixel_texture
-
GL_PIXEL_TEX_GEN_EXT
is part of the EXT_pixel_texture extension.
- GL_EXT_rescale_normal
-
GL_RESCALE_NORMAL_EXT
is part of the EXT_rescale_normal extension.
- GL_EXT_texture3D
-
GL_TEXTURE_3D_EXT
is part of the EXT_texture3D extension.
- GL_EXT_texture_color_table
- GL_TEXTURE_COLOR_TABLE_EXT is part of the EXT_texture_color_table
extension.
ERRORS
GL_INVALID_ENUM is generated if cap is not one of the accepted values.
GL_INVALID_OPERATION is generated if glPixelTransfer is called between a
call to glBegin and the corresponding call to
glEnd.
ASSOCIATED GETS
glGet
glIsEnabled
SEE ALSO
glAlphaFunc,
glBitmap,
glBlendFunc,
glClipPlane,
glColorMaterial,
glColorTableEXT,
glCopyColorTableEXT,
glCopyPixels,
glCopyTexImage1D,
glCopyTexImage2D,
glCopyTexSubImage1D,
glCopyTexSubImage2D,
glCopyTexSubImage3DEXT,
glCullFace,
glDepthFunc,
glDepthRange,
glDrawPixels,
glEnableClientState,
glFog,
glGet,
glGetString,
glIsEnabled,
glLight,
glLightModel,
glLineWidth,
glLineStipple,
glLogicOp,
glMap1,
glMap2,
glMaterial,
glNormal,
glPointSize,
glPolygonMode,
glPolygonOffset,
glPolygonStipple,
glSampleMaskEXT,
glScissor,
glStencilFunc,
glStencilOp,
glTexGen,
glTexImage1D,
glTexImage2D,
glTexImage3DEXT,
glTexSubImage1D,
glTexSubImage2D,
glTexSubImage3DEXT