GLENABLE(3G)
π NAME π
okay so bestie, this is GLENABLE(3G) β the glEnable manual page, and it's literally the "enable or disable server-side GL capabilities" page. Think of it as the GL switchboard: you flip capabilities on with glEnable-type calls and off with glDisable-type calls, and the vibes of your render depend on which switches are on. π
β¨ C SPECIFICATION β¨
void glEnable(GLenum cap);
void glDisable(GLenum cap);
void glEnablei(GLenum cap, GLuint index);
void glDisablei(GLenum cap, GLuint index);
πΈ PARAMETERS πΈ
capβ specifies a symbolic constant indicating a GL capability. This is the main character argument, ngl.indexβ specifies the index of the switch to disable (forglEnableiandglDisableionly). Yes, "switch to disable" even on the enable-y side; that's what the page says, bestie.
π DESCRIPTION π
glEnable and glDisable enable and disable various capabilities. Use glIsEnabled() or glGet() to determine the current setting of any capability. π«Ά
Initial-value tea: 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. So those two start flipped on; everything else starts off. Not me memorizing that for the vibe check. π
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. SeeglBlendFunc().GL_CLIP_DISTANCEiβ 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. SeeglLogicOp().GL_CULL_FACEβ If enabled, cull polygons based on their winding in window coordinates. SeeglCullFace().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 whenGL_DEBUG_OUTPUTis 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. SeeglDebugMessageCallback().GL_DEPTH_CLAMPβ If enabled, the-wcβ€zcβ€wcplane equation is ignored by view volume clipping (effectively, there is no near or far plane clipping). SeeglDepthRange().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. SeeglDepthFunc()andglDepthRange().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 ofGL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODINGfor the framebuffer attachment corresponding to the destination buffer isGL_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. SeeglLineWidth().GL_MULTISAMPLEβ If enabled, use multiple fragment samples in computing the final color of a pixel. SeeglSampleCoverage().GL_POLYGON_OFFSET_FILLβ If enabled, and if the polygon is rendered inGL_FILLmode, an offset is added to depth values of a polygon's fragments before the depth comparison is performed. SeeglPolygonOffset().GL_POLYGON_OFFSET_LINEβ If enabled, and if the polygon is rendered inGL_LINEmode, an offset is added to depth values of a polygon's fragments before the depth comparison is performed. SeeglPolygonOffset().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 inGL_POINTmode. SeeglPolygonOffset().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. SeeglPrimitiveRestartIndex().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 to2nβ1where n is equal to 8 forGL_UNSIGNED_BYTE, 16 forGL_UNSIGNED_SHORTand 32 forGL_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(), andglClearTexSubImage()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. IfGL_SAMPLE_COVERAGE_INVERTis set toGL_TRUE, invert the coverage value. SeeglSampleCoverage().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 ofGL_MIN_SAMPLE_SHADING_VALUE. SeeglMinSampleShading().GL_SAMPLE_MASKβ If enabled, the sample coverage mask generated for a fragment during rasterization will be ANDed with the value ofGL_SAMPLE_MASK_VALUEbefore shading occurs. SeeglSampleMaski().GL_SCISSOR_TESTβ If enabled, discard fragments that are outside the scissor rectangle. SeeglScissor().GL_STENCIL_TESTβ If enabled, do stencil testing and update the stencil buffer. SeeglStencilFunc()andglStencilOp().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 builtingl_PointSizeand clamped to the implementation-dependent point size range.
π₯ ERRORS π₯
GL_INVALID_ENUMis generated ifcapis not one of the values listed previously. So if you pass a random enum, GL is gonna side-eye you with this one. πGL_INVALID_VALUEis generated byglEnableiandglDisableiifindexis greater than or equal to the number of indexed capabilities forcap.
π§ NOTES π§
GL_PRIMITIVE_RESTARTis available only if the GL version is 3.1 or greater.GL_TEXTURE_CUBE_MAP_SEAMLESSis available only if the GL version is 3.2 or greater.GL_PRIMITIVE_RESTART_FIXED_INDEXis available only if the GL version is 4.3 or greater.GL_DEBUG_OUTPUTandGL_DEBUG_OUTPUT_SYNCHRONOUSare available only if the GL version is 4.3 or greater.- Any token accepted by
glEnableorglDisableis also accepted byglEnableiandglDisablei, but if the capability is not indexed, the maximum value thatindexmay take is zero. - In general, passing an indexed capability to
glEnableorglDisablewill enable or disable that capability for all indices, respectively.
π¦ ASSOCIATED GETS π¦
glIsEnabled()glGet()
β¨ VERSION SUPPORT β¨
oop this is the part everyone skips and then regrets skipping π bestie, please actually read this one β it's literally just "which OpenGL version do I need for this function to Even Exist". The columns are OpenGL 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5. A β means yes queen it's supported, a - means nope, not in that version, don't come for me. π
π«Ά glDisable
2.0β β supported2.1β β supported3.0β β supported3.1β β supported3.2β β supported3.3β β supported4.0β β supported4.1β β supported4.2β β supported4.3β β supported4.4β β supported4.5β β supported
πΈ glDisablei
2.0β-not supported2.1β-not supported3.0β β supported3.1β β supported3.2β β supported3.3β β supported4.0β β supported4.1β β supported4.2β β supported4.3β β supported4.4β β supported4.5β β supported
π¦ glEnable
2.0β β supported2.1β β supported3.0β β supported3.1β β supported3.2β β supported3.3β β supported4.0β β supported4.1β β supported4.2β β supported4.3β β supported4.4β β supported4.5β β supported
π glEnablei
2.0β-not supported2.1β-not supported3.0β β supported3.1β β supported3.2β β supported3.3β β supported4.0β β supported4.1β β supported4.2β β supported4.3β β supported4.4β β supported4.5β β supported
iykyk: theivariants (glEnablei,glDisablei) are the indexed ones, and they did not exist before OpenGL3.0. So if you're on2.0or2.1and reaching forglEnablei, that's a no from the version table, bestie π stick toglEnable/glDisable.
π SEE ALSO β¨
the whole friend group, go say hi π
glActiveTexture()glBlendFunc()glCullFace()glDepthFunc()glDepthRange()glGet()glIsEnabled()glLineWidth()glLogicOp()glPointSize()glPolygonMode()glPolygonOffset()glSampleCoverage()glScissor()glStencilFunc()glStencilOp()glTexImage1D()glTexImage2D()glTexImage3D()
π 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/.
π COPYRIGHT (yes, again, they really said it twice)
Copyright Β© 1991-2006 Silicon Graphics, Inc.
Copyright Β© 2011-2014 Khronos Group
and that's the whole page, bestie, you made it to the end π«Άβ¨ the source line is literally just [FIXME: source] (iconic honestly, they left it as a TODO and never came back π), version GLENABLE(3G), dated 08/09/2021. slay, go enable something πππ
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms