1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566
|
<!DOCTYPE refentry [ <!ENTITY % mathent SYSTEM "math.ent"> %mathent; ]>
<!-- Converted by db4-upgrade version 1.1 -->
<refentry xmlns="http://docbook.org/ns/docbook" version="5.0" xml:id="glEnable">
<info>
<copyright>
<year>1991-2006</year>
<holder>Silicon Graphics, Inc.</holder>
</copyright>
<copyright>
<year>2011-2014</year>
<holder>Khronos Group</holder>
</copyright>
</info>
<refmeta>
<refentrytitle>glEnable</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glEnable</refname>
<refpurpose>enable or disable server-side GL capabilities</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glEnable</function></funcdef>
<paramdef>GLenum <parameter>cap</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDisable</function></funcdef>
<paramdef>GLenum <parameter>cap</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glEnablei</function></funcdef>
<paramdef>GLenum <parameter>cap</parameter></paramdef>
<paramdef>GLuint <parameter>index</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDisablei</function></funcdef>
<paramdef>GLenum <parameter>cap</parameter></paramdef>
<paramdef>GLuint <parameter>index</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 xml:id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>cap</parameter></term>
<listitem>
<para>
Specifies a symbolic constant indicating a GL capability.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>index</parameter></term>
<listitem>
<para>
Specifies the index of the switch to disable (for
<function>glEnablei</function> and
<function>glDisablei</function> only).
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 xml:id="description"><title>Description</title>
<para>
<function>glEnable</function> and <function>glDisable</function>
enable and disable various capabilities. Use
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry>
or
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
to determine the current setting of any capability. The initial
value for each capability with the exception of
<constant>GL_DITHER</constant> and
<constant>GL_MULTISAMPLE</constant> is
<constant>GL_FALSE</constant>. The initial value for
<constant>GL_DITHER</constant> and
<constant>GL_MULTISAMPLE</constant> is
<constant>GL_TRUE</constant>.
</para>
<para>
Both <function>glEnable</function> and <function>glDisable</function> take a single argument, <parameter>cap</parameter>,
which can assume one of the following values:
</para>
<para>
Some of the GL's capabilities are indexed. <function>glEnablei</function> and <function>glDisablei</function> enable and disable
indexed capabilities.
</para>
<variablelist>
<varlistentry>
<term><constant>GL_BLEND</constant></term>
<listitem>
<para>
</para>
<para>
If enabled,
blend the computed fragment color values with the values in the color
buffers. See <citerefentry><refentrytitle>glBlendFunc</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_CLIP_DISTANCE</constant><emphasis>i</emphasis></term>
<listitem>
<para>
</para>
<para>
If enabled, clip geometry against user-defined half space <emphasis>i</emphasis>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_COLOR_LOGIC_OP</constant></term>
<listitem>
<para>
</para>
<para>
If enabled,
apply the currently selected logical operation to the computed fragment
color and color buffer values. See <citerefentry><refentrytitle>glLogicOp</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_CULL_FACE</constant></term>
<listitem>
<para>
</para>
<para>
If enabled,
cull polygons based on their winding in window coordinates.
See <citerefentry><refentrytitle>glCullFace</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_DEBUG_OUTPUT</constant></term>
<listitem>
<para>
</para>
<para>
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 <constant>GL_DEBUG_OUTPUT</constant>
is enabled.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_DEBUG_OUTPUT_SYNCHRONOUS</constant></term>
<listitem>
<para>
</para>
<para>
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 <citerefentry><refentrytitle>glDebugMessageCallback</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_DEPTH_CLAMP</constant></term>
<listitem>
<para>
</para>
<para>
If enabled,
the
<!-- - wc <= zc <= wc -->
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
<mml:mo>-</mml:mo><mml:msub><mml:mi>w</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>≤</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>≤</mml:mo><mml:msub><mml:mi>w</mml:mi><mml:mi>c</mml:mi></mml:msub>
</mml:math></inlineequation>
plane equation is ignored by view volume clipping (effectively, there is no near or
far plane clipping).
See <citerefentry><refentrytitle>glDepthRange</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_DEPTH_TEST</constant></term>
<listitem>
<para>
</para>
<para>
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
<citerefentry><refentrytitle>glDepthFunc</refentrytitle></citerefentry> and
<citerefentry><refentrytitle>glDepthRange</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_DITHER</constant> </term>
<listitem>
<para>
</para>
<para>
If enabled,
dither color components or indices before they are written to the
color buffer.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_FRAMEBUFFER_SRGB</constant> </term>
<listitem>
<para>
</para>
<para>
If enabled
and the value of <constant>GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING</constant> for the
framebuffer attachment corresponding to the destination buffer is <constant>GL_SRGB</constant>,
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.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_LINE_SMOOTH</constant></term>
<listitem>
<para>
</para>
<para>
If enabled,
draw lines with correct filtering.
Otherwise,
draw aliased lines.
See <citerefentry><refentrytitle>glLineWidth</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_MULTISAMPLE</constant></term>
<listitem>
<para>
</para>
<para>
If enabled,
use multiple fragment samples in computing the final color of a pixel.
See <citerefentry><refentrytitle>glSampleCoverage</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_POLYGON_OFFSET_FILL</constant></term>
<listitem>
<para>
</para>
<para>
If enabled, and if the polygon is rendered in
<constant>GL_FILL</constant> mode, an offset is added to depth values of a polygon's
fragments before the depth comparison is performed.
See <citerefentry><refentrytitle>glPolygonOffset</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_POLYGON_OFFSET_LINE</constant></term>
<listitem>
<para>
</para>
<para>
If enabled, and if the polygon is rendered in
<constant>GL_LINE</constant> mode, an offset is added to depth values of a polygon's
fragments before the depth comparison is performed.
See <citerefentry><refentrytitle>glPolygonOffset</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_POLYGON_OFFSET_POINT</constant></term>
<listitem>
<para>
</para>
<para>
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
<constant>GL_POINT</constant> mode. See <citerefentry><refentrytitle>glPolygonOffset</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_POLYGON_SMOOTH</constant></term>
<listitem>
<para>
</para>
<para>
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.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_PRIMITIVE_RESTART</constant></term>
<listitem>
<para>
</para>
<para>
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 <citerefentry><refentrytitle>glPrimitiveRestartIndex</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_PRIMITIVE_RESTART_FIXED_INDEX</constant></term>
<listitem>
<para>
</para>
<para>
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
<inlineequation><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:msup><mml:mn>2</mml:mn><mml:mi>n</mml:mi></mml:msup><mml:mo>−</mml:mo><mml:mn>1</mml:mn></mml:math></inlineequation>
where <emphasis>n</emphasis> is equal to 8 for <constant>GL_UNSIGNED_BYTE</constant>,
16 for <constant>GL_UNSIGNED_SHORT</constant> and 32 for <constant>GL_UNSIGNED_INT</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_RASTERIZER_DISCARD</constant></term>
<listitem>
<para>
</para>
<para>
If enabled,
primitives are discarded after the optional transform feedback stage,
but before rasterization. Furthermore, when enabled, <citerefentry><refentrytitle>glClear</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glClearBufferData</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glClearBufferSubData</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glClearTexImage</refentrytitle></citerefentry>, and
<citerefentry><refentrytitle>glClearTexSubImage</refentrytitle></citerefentry> are ignored.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_SAMPLE_ALPHA_TO_COVERAGE</constant></term>
<listitem>
<para>
</para>
<para>
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.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_SAMPLE_ALPHA_TO_ONE</constant></term>
<listitem>
<para>
</para>
<para>
If enabled,
each sample alpha value is replaced by the maximum representable alpha value.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_SAMPLE_COVERAGE</constant></term>
<listitem>
<para>
</para>
<para>
If enabled,
the fragment's coverage is ANDed with the temporary coverage value. If
<constant>GL_SAMPLE_COVERAGE_INVERT</constant> is set to <constant>GL_TRUE</constant>, invert the coverage
value.
See <citerefentry><refentrytitle>glSampleCoverage</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_SAMPLE_SHADING</constant></term>
<listitem>
<para>
</para>
<para>
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 <constant>GL_MIN_SAMPLE_SHADING_VALUE</constant>.
See <citerefentry><refentrytitle>glMinSampleShading</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_SAMPLE_MASK</constant></term>
<listitem>
<para>
</para>
<para>
If enabled, the sample coverage mask generated for a fragment during rasterization
will be ANDed with the value of <constant>GL_SAMPLE_MASK_VALUE</constant> before
shading occurs.
See <citerefentry><refentrytitle>glSampleMaski</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_SCISSOR_TEST</constant></term>
<listitem>
<para>
</para>
<para>
If enabled,
discard fragments that are outside the scissor rectangle.
See <citerefentry><refentrytitle>glScissor</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_STENCIL_TEST</constant></term>
<listitem>
<para>
</para>
<para>
If enabled,
do stencil testing and update the stencil buffer.
See <citerefentry><refentrytitle>glStencilFunc</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glStencilOp</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_TEXTURE_CUBE_MAP_SEAMLESS</constant></term>
<listitem>
<para>
</para>
<para>
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.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_PROGRAM_POINT_SIZE</constant></term>
<listitem>
<para>
</para>
<para>
If enabled
and a vertex or geometry shader is active, then the derived point size is taken from the (potentially clipped) shader builtin
<constant>gl_PointSize</constant> and clamped to the implementation-dependent point size range.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 xml:id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>cap</parameter> is not one of the values
listed previously.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated by <function>glEnablei</function> and <function>glDisablei</function>
if <parameter>index</parameter> is greater than or equal to the number of indexed capabilities for <parameter>cap</parameter>.
</para>
</refsect1>
<refsect1 xml:id="notes"><title>Notes</title>
<para>
<constant>GL_PRIMITIVE_RESTART</constant> is available only if the GL version is 3.1 or greater.
</para>
<para>
<constant>GL_TEXTURE_CUBE_MAP_SEAMLESS</constant> is available only if the GL version is 3.2 or greater.
</para>
<para>
<constant>GL_PRIMITIVE_RESTART_FIXED_INDEX</constant> is available only if the GL version is 4.3 or greater.
</para>
<para>
<constant>GL_DEBUG_OUTPUT</constant> and <constant>GL_DEBUG_OUTPUT_SYNCHRONOUS</constant> are available only if the GL version is 4.3 or greater.
</para>
<para>
Any token accepted by <function>glEnable</function> or <function>glDisable</function> is also accepted by
<function>glEnablei</function> and <function>glDisablei</function>, but if the capability is not indexed,
the maximum value that <parameter>index</parameter> may take is zero.
</para>
<para>
In general, passing an indexed capability to <function>glEnable</function> or <function>glDisable</function>
will enable or disable that capability for all indices, resepectively.
</para>
</refsect1>
<refsect1 xml:id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry>
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 xml:id="versions"><title>Version Support</title>
<informaltable>
<tgroup cols="13" align="left">
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apifunchead.xml" xpointer="xpointer(/*/*)"/>
<tbody>
<row>
<entry><function>glDisable</function></entry>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apiversion.xml" xpointer="xpointer(/*/*[@role='20']/*)"/>
</row>
<row>
<entry><function>glDisablei</function></entry>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apiversion.xml" xpointer="xpointer(/*/*[@role='30']/*)"/>
</row>
<row>
<entry><function>glEnable</function></entry>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apiversion.xml" xpointer="xpointer(/*/*[@role='20']/*)"/>
</row>
<row>
<entry><function>glEnablei</function></entry>
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="apiversion.xml" xpointer="xpointer(/*/*[@role='30']/*)"/>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 xml:id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glActiveTexture</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBlendFunc</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCullFace</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDepthFunc</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDepthRange</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glLineWidth</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glLogicOp</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPointSize</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPolygonMode</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPolygonOffset</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glSampleCoverage</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glScissor</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glStencilFunc</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glStencilOp</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 xml:id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"/> 1991-2006 Silicon Graphics, Inc.
Copyright <trademark class="copyright"/> 2011-2014 Khronos Group.
This document is licensed under the SGI
Free Software B License. For details, see
<link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</link>.
</para>
</refsect1>
</refentry>
|