Signature
Parameters
Variables | Description |
---|---|
cap |
Specifies a symbolic constant indicating a GL capability.
|
index |
Specifies the index of the switch to disable (for
glEnablei
and
glDisablei
only).
|
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 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:
Some of the GL's capabilities are indexed.
glEnablei
and
glDisablei
enable and disable
indexed capabilities.
- GL_BLEND
-
If enabled, blend the computed fragment color values with the values in the color buffers. See glBlendFunc .
- GL_CLIP_DISTANCE i
-
If enabled, clip geometry against user-defined half space i .
- GL_COLOR_LOGIC_OP
-
If enabled, apply the currently selected logical operation to the computed fragment color and color buffer values. See glLogicOp .
- GL_CULL_FACE
-
If enabled, cull polygons based on their winding in window coordinates. See glCullFace .
- GL_DEBUG_OUTPUT
-
If enabled, debug messages are produced by a debug context. When disabled, the debug message log is silenced. Note that in a non-debug context, very few, if any messages might be produced, even when GL_DEBUG_OUTPUT is enabled.
- GL_DEBUG_OUTPUT_SYNCHRONOUS
-
If enabled, debug messages are produced synchronously by a debug context. If disabled, debug messages may be produced asynchronously. In particular, they may be delayed relative to the execution of GL commands, and the debug callback function may be called from a thread other than that in which the commands are executed. See glDebugMessageCallback .
- GL_DEPTH_CLAMP
-
If enabled, the plane equation is ignored by view volume clipping (effectively, there is no near or far plane clipping). See glDepthRange .
- 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_FRAMEBUFFER_SRGB
-
If enabled and the value of GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING for the framebuffer attachment corresponding to the destination buffer is GL_SRGB , the R, G, and B destination color values (after conversion from fixed-point to floating-point) are considered to be encoded for the sRGB color space and hence are linearized prior to their use in blending.
- GL_LINE_SMOOTH
-
If enabled, draw lines with correct filtering. Otherwise, draw aliased lines. See glLineWidth .
- GL_MULTISAMPLE
-
If enabled, use multiple fragment samples in computing the final color of a pixel. See glSampleCoverage .
- 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 antialiased polygons, an alpha buffer is needed and the polygons must be sorted front to back.
- GL_PRIMITIVE_RESTART
-
Enables primitive restarting. If enabled, any one of the draw commands which transfers a set of generic attribute array elements to the GL will restart the primitive when the index of the vertex is equal to the primitive restart index. See glPrimitiveRestartIndex .
- GL_PRIMITIVE_RESTART_FIXED_INDEX
-
Enables primitive restarting with a fixed index. If enabled, any one of the draw commands which transfers a set of generic attribute array elements to the GL will restart the primitive when the index of the vertex is equal to the fixed primitive index for the specified index type. The fixed index is equal to where n is equal to 8 for GL_UNSIGNED_BYTE , 16 for GL_UNSIGNED_SHORT and 32 for GL_UNSIGNED_INT .
- GL_RASTERIZER_DISCARD
-
If enabled, primitives are discarded after the optional transform feedback stage, but before rasterization. Furthermore, when enabled, glClear , glClearBufferData , glClearBufferSubData , glClearTexImage , and glClearTexSubImage are ignored.
- GL_SAMPLE_ALPHA_TO_COVERAGE
-
If enabled, compute a temporary coverage value 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.
- GL_SAMPLE_ALPHA_TO_ONE
-
If enabled, each sample alpha value is replaced by the maximum representable alpha value.
- GL_SAMPLE_COVERAGE
-
If enabled, the fragment's coverage is ANDed with the temporary coverage value. If GL_SAMPLE_COVERAGE_INVERT is set to GL_TRUE , invert the coverage value. See glSampleCoverage .
- GL_SAMPLE_SHADING
-
If enabled, the active fragment shader is run once for each covered sample, or at fraction of this rate as determined by the current value of GL_MIN_SAMPLE_SHADING_VALUE . See glMinSampleShading .
- GL_SAMPLE_MASK
-
If enabled, the sample coverage mask generated for a fragment during rasterization will be ANDed with the value of GL_SAMPLE_MASK_VALUE before shading occurs. See glSampleMaski .
- 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_CUBE_MAP_SEAMLESS
-
If enabled, cubemap textures are sampled such that when linearly sampling from the border between two adjacent faces, texels from both faces are used to generate the final sample value. When disabled, texels from only a single face are used to construct the final sample value.
- GL_PROGRAM_POINT_SIZE
-
If enabled and a vertex or geometry shader is active, then the derived point size is taken from the (potentially clipped) shader builtin gl_PointSize and clamped to the implementation-dependent point size range.
Errors
GL_INVALID_ENUM
is generated if
cap
is not one of the values
listed previously.
GL_INVALID_VALUE
is generated by
glEnablei
and
glDisablei
if
index
is greater than or equal to the number of indexed capabilities for
cap
.
Notes
GL_PRIMITIVE_RESTART
is available only if the GL version is 3.1 or greater.
GL_TEXTURE_CUBE_MAP_SEAMLESS
is available only if the GL version is 3.2 or greater.
GL_PRIMITIVE_RESTART_FIXED_INDEX
is available only if the GL version is 4.3 or greater.
GL_DEBUG_OUTPUT
and
GL_DEBUG_OUTPUT_SYNCHRONOUS
are available only if the GL version is 4.3 or greater.
Any token accepted by
glEnable
or
glDisable
is also accepted by
glEnablei
and
glDisablei
, but if the capability is not indexed,
the maximum value that
index
may take is zero.
Associated Gets
Version Support
glDisable | |
glDisablei | |
glEnable | |
glEnablei |
See Also
Copyright
Copyright
1991-2006 Silicon Graphics, Inc.
Copyright
2011-2014 Khronos Group.
This document is licensed under the SGI
Free Software B License. For details, see
http://oss.sgi.com/projects/FreeB/
.
Sample Code References
The following code samples have been found which appear to reference the functions described here. Take care that the code may be old, broken or not even use PyOpenGL.
glDisable
{Artistic License} PymmLib
pymmlib/mmLib/OpenGLDriver.py
Lines: 190, 196, 201, 206, 222, 224, 287, 327, 343, 438, 472, 486, 514, 564
{LGPL} VisionEgg
VisionEgg/MoreStimuli.py
Lines: 120, 121, 174, 243, 247, 251, 324, 325, 387, 452, 453, 454, 525
{LGPL or GPL or MPL} Kamaelia
Code/Python/Kamaelia/Kamaelia/Visualisation/PhysicsGraph3D/Particles3D.py
Lines: 417, 541, 587, 634
{LGPL or GPL or MPL} Kamaelia
Code/Python/Kamaelia/Kamaelia/UI/OpenGL/OpenGLDisplay.py
Lines: 837, 876, 907
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/OpenGLDisplay.py
Lines: 815, 854, 885
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/PygameWrapper.py
Lines: 204
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/ProgressBar.py
Lines: 176
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/Button.py
Lines: 202, 272
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/TexPlane.py
Lines: 107, 141
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/Label.py
Lines: 169, 209
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Sketches/playground/Button.py
Lines: 126, 175
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Sketches/playground/PygameWrapperPlane.py
Lines: 90
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Sketches/playground/TexPlane.py
Lines: 68, 101
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Sketches/playground/Display3D.py
Lines: 498, 504, 543
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Visualisation/PhysicsGraph3D/Particles3D.py
Lines: 417, 541, 587, 634
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/OpenGLDisplay.py
Lines: 837, 876, 907
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/PygameWrapper.py
Lines: 204
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/ProgressBar.py
Lines: 176
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/Button.py
Lines: 194, 261
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/TexPlane.py
Lines: 107, 141
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/Label.py
Lines: 169, 209
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/OpenGLDisplay.py
Lines: 814, 853, 884
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/PygameWrapper.py
Lines: 204
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/ProgressBar.py
Lines: 176
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/Button.py
Lines: 194, 261
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/TexPlane.py
Lines: 107, 141
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/Label.py
Lines: 169, 209
glEnable
OpenGL-Demo
PyOpenGL-Demo/NeHe/lesson26.py
Lines: 59, 63, 68, 69, 104, 106, 107, 150, 158, 163, 180, 187
{Artistic License} PymmLib
pymmlib/mmLib/OpenGLDriver.py
Lines: 162, 164, 177, 194, 199, 204, 210, 215, 282, 322, 355, 467, 502
{LGPL} VisionEgg
VisionEgg/Textures.py
Lines: 1293, 1451, 1454, 1457, 1583, 1587, 1600, 1757, 1758, 1759
{LGPL or GPL or MPL} Kamaelia
Code/Python/Kamaelia/Kamaelia/Visualisation/PhysicsGraph3D/Particles3D.py
Lines: 411, 515, 579, 625
{LGPL or GPL or MPL} Kamaelia
Code/Python/Kamaelia/Kamaelia/UI/OpenGL/OpenGLDisplay.py
Lines: 461, 468, 838, 877, 900
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/Experiments/Cubes.py
Lines: 75, 83, 93, 267, 271, 274
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/Experiments/Spheres.py
Lines: 55, 60, 76, 77, 78
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/OpenGLDisplay.py
Lines: 460, 467, 816, 855, 878
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/PygameWrapper.py
Lines: 188
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/ProgressBar.py
Lines: 137
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/Button.py
Lines: 173, 266
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/TexPlane.py
Lines: 93, 135
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Kamaelia/UI/OpenGL/Label.py
Lines: 144, 203
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Examples/simplecube/simplecube_controlled.py
Lines: 88
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Examples/simplecube/simplecube.py
Lines: 35
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Sketches/Display3D.py
Lines: 136, 141, 445, 460, 493
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Sketches/playground/Button.py
Lines: 101, 169
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Sketches/playground/PygameWrapperPlane.py
Lines: 71
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Sketches/playground/TexPlane.py
Lines: 53, 95
{LGPL or GPL or MPL} Kamaelia
Sketches/CL/Topology3D/THF/Sketches/playground/Display3D.py
Lines: 145, 491, 505, 544
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Visualisation/PhysicsGraph3D/Particles3D.py
Lines: 411, 515, 579, 625
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/OpenGLDisplay.py
Lines: 461, 468, 838, 877, 900
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/PygameWrapper.py
Lines: 188
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/ProgressBar.py
Lines: 137
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/Button.py
Lines: 169, 255
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/TexPlane.py
Lines: 93, 135
{LGPL or GPL or MPL} Kamaelia
Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/UI/OpenGL/Label.py
Lines: 144, 203
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/OpenGLDisplay.py
Lines: 460, 467, 815, 854, 877
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/PygameWrapper.py
Lines: 188
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/ProgressBar.py
Lines: 137
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/Button.py
Lines: 169, 255
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/TexPlane.py
Lines: 93, 135
{LGPL or GPL or MPL} Kamaelia
Sketches/THF/Packages/Kamaelia/Community/THF/Kamaelia/UI/OpenGL/Label.py
Lines: 144, 203