Opentk/Source/Bind/Specifications/Docs/glEnable.xml
2010-11-21 14:34:29 +00:00

470 lines
21 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glEnable">
<refmeta>
<refmetainfo>
<copyright>
<year>1991-2006</year>
<holder>Silicon Graphics, Inc.</holder>
</copyright>
</refmetainfo>
<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>
</refsynopsisdiv>
<refsect1 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>
</variablelist>
</refsect1>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDisable</function></funcdef>
<paramdef>GLenum <parameter>cap</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters2"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>cap</parameter></term>
<listitem>
<para>
Specifies a symbolic constant indicating a GL capability.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glEnablei</function></funcdef>
<paramdef>GLenum <parameter>cap</parameter></paramdef>
<paramdef>GLuint <parameter>index</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters3"><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 swtich to enable.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDisablei</function></funcdef>
<paramdef>GLenum <parameter>cap</parameter></paramdef>
<paramdef>GLuint <parameter>index</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters4"><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 swtich to disable.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glEnable</function> and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> 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 <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> take a single argument, <parameter>cap</parameter>,
which can assume one of the following values:
</para>
<para>
Some of the GL's capabilities are indicated. <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_DEPTH_CLAMP</constant></term>
<listitem>
<para>
</para>
<para>
If enabled,
the
<!-- - wc <= zc <= wc -->
<inlineequation><mml:math>
<mml:mo>-</mml:mo><mml:msub><mml:mi>w</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>&le;</mml:mo><mml:msub><mml:mi>z</mml:mi><mml:mi>c</mml:mi></mml:msub><mml:mo>&le;</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_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_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_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, modifies the way sampling is performed on cube map textures. See the spec for more information.
</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 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 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>
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 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry>
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 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 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 1991-2006
Silicon Graphics, Inc. Copyright <trademark class="copyright"></trademark> 2010 Khronos Group.
This document is licensed under the SGI
Free Software B License. For details, see
<ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
</para>
</refsect1>
</refentry>