<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
<!-- saved from url=(0013)about:internet -->
<?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>glGetLight</title><meta name="generator" content="DocBook XSL Stylesheets V1.74.0" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glGetLight"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glGetLight — return light source parameter values</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">void <b class="fsfunc">glGetLightfv</b>(</code></td><td>GLenum <var class="pdparam">light</var>, </td></tr><tr><td> </td><td>GLenum <var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>GLfloat * <var class="pdparam">params</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">void <b class="fsfunc">glGetLightxv</b>(</code></td><td>GLenum <var class="pdparam">light</var>, </td></tr><tr><td> </td><td>GLenum <var class="pdparam">pname</var>, </td></tr><tr><td> </td><td>GLfixed * <var class="pdparam">params</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term">
                    <em class="parameter"><code>light</code></em>
                </span></dt><dd><p>
                    Specifies a light source. The number of possible
                    lights depends on the implementation, but at least
                    eight lights are supported. They
                    are identified by symbolic names of the form
                    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                    <mml:mi>GL_LIGHTi</mml:mi> where
                    <mml:mi>0</mml:mi><mml:mo>&lt;</mml:mo><mml:mi>i</mml:mi><mml:mo>&lt;</mml:mo>
                    <mml:mi>GL_MAX_LIGHTS</mml:mi>
                    </mml:math>
                    </p></dd><dt><span class="term">
                    <em class="parameter"><code>pname</code></em>
                </span></dt><dd><p>
                    Specifies a light source parameter for light.
                    Accepted symbolic names are
                    <code class="constant">GL_AMBIENT</code>,
                    <code class="constant">GL_DIFFUSE</code>,
                    <code class="constant">GL_SPECULAR</code>,
                    <code class="constant">GL_POSITION</code>,
                    <code class="constant">GL_SPOT_DIRECTION</code>,
                    <code class="constant">GL_SPOT_EXPONENT</code>,
                    <code class="constant">GL_SPOT_CUTOFF</code>,
                    <code class="constant">GL_CONSTANT_ATTENUATION</code>,
                    <code class="constant">GL_LINEAR_ATTENUATION</code>, and
                    <code class="constant">GL_QUADRATIC_ATTENUATION</code>.
                    </p></dd><dt><span class="term">
                    <em class="parameter"><code>params</code></em>
                </span></dt><dd><p>
                    Returns the requested data.
                    </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
        <code class="function">glGetLight</code>
        returns in <em class="parameter"><code>params</code></em> the value or values of a light
        source parameter.
        <em class="parameter"><code>light</code></em> names the light and is a symbolic
        name of the form
        <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
        <mml:mi>GL_LIGHTi</mml:mi> for
        <mml:mi>0</mml:mi><mml:mo>&lt;</mml:mo><mml:mi>i</mml:mi><mml:mo>&lt;</mml:mo>
        <mml:mi>GL_MAX_LIGHTS</mml:mi>
        </mml:math>
        where <code class="constant">GL_MAX_LIGHTS</code> is an
        implementation dependent constant that
        is greater than or equal to eight.
        <em class="parameter"><code>pname</code></em> specifies one of
        ten light source parameters, again by symbolic name.
        </p><p>The ten light parameters are defined:</p><div class="variablelist"><dl><dt><span class="term">
                    <code class="constant">GL_AMBIENT</code>
                </span></dt><dd><p>
                    <em class="parameter"><code>params</code></em>
                    returns four fixed-point or floating-point values that
                    specify the ambient RGBA intensity of the light. Both
                    fixed-point and floating-point values are mapped
                    directly. Neither fixed-point nor floating-point values
                    are clamped.
                    The initial ambient light intensity is (0, 0, 0, 1).
                    </p></dd><dt><span class="term">
                    <code class="constant">GL_DIFFUSE</code>
                </span></dt><dd><p>
                    <em class="parameter"><code>params</code></em>
                    returns four fixed-point or floating-point values that
                    specify the diffuse RGBA intensity of the light. Both
                    fixed-point and floating-point values are mapped
                    directly. Neither fixed-point nor floating-point values
                    are clamped.
                    The initial value for <code class="constant">GL_LIGHT0</code>
                    is (1, 1, 1, 1).
                    For other lights, the initial value is (0, 0, 0, 0).
                    </p></dd><dt><span class="term">
                    <code class="constant">GL_SPECULAR</code>
                </span></dt><dd><p>
                    <em class="parameter"><code>params</code></em>
                    returns four fixed-point or floating-point values that
                    specify the specular RGBA intensity of the light. Both
                    fixed-point and floating-point values are mapped
                    directly. Neither fixed-point nor floating-point values
                    are clamped.
                    The initial value for <code class="constant">GL_LIGHT0</code>
                    is (1, 1, 1, 1).
                    For other lights, the initial value is (0, 0, 0, 0).
                    </p></dd><dt><span class="term"><code class="constant">GL_POSITION</code></span></dt><dd><p>
                        <em class="parameter"><code>params</code></em> returns four fixed-point or floating-point values representing the
                        position of the light source.
                        Both fixed-point and floating-point values are mapped
                        directly.
                        The returned values are those maintained in eye coordinates.
                        They will not be equal to the values specified using <a class="citerefentry" href="glLight.xml"><span class="citerefentry"><span class="refentrytitle">glLight</span></span></a>,
                        unless the modelview matrix was identity at the time <a class="citerefentry" href="glLight.xml"><span class="citerefentry"><span class="refentrytitle">glLight</span></span></a> was
                        called. The initial value is (0, 0, 1, 0).
                    </p></dd><dt><span class="term">
                    <code class="constant">GL_SPOT_DIRECTION</code>
                </span></dt><dd><p>
                    <em class="parameter"><code>params</code></em>
                    returns three fixed-point or floating-point values that
                    specify the direction of the light in homogeneous object
                    coordinates. Both fixed-point and floating-point values
                    are mapped directly. Neither fixed-point nor
                    floating-point values are clamped.
                    The initial direction is (0, 0, -1).
                    </p></dd><dt><span class="term">
                    <code class="constant">GL_SPOT_EXPONENT</code>
                </span></dt><dd><p>
                    <em class="parameter"><code>params</code></em>
                    returns a single fixed-point or floating-point value that
                    specifies the intensity distribution of the light.
                    Fixed-point and floating-point values are mapped
                    directly. Only values in the range [0, 128] are
                    accepted.
                    The initial spot exponent is 0.
                    </p></dd><dt><span class="term">
                    <code class="constant">GL_SPOT_CUTOFF</code>
                </span></dt><dd><p>
                    <em class="parameter"><code>params</code></em>
                    returns a single fixed-point or floating-point value that
                    specifies the maximum spread angle of a light source.
                    Fixed-point and floating-point values are mapped
                    directly. Only values in the range [0, 90] and the special
                    value 180 are accepted. If the angle between the
                    direction of the light and the direction from the light
                    to the vertex being lighted is greater than the spot
                    cutoff angle, the light is completely masked.
                    Otherwise, its intensity is controlled by the spot
                    exponent and the attenuation factors. The initial spot
                    cutoff is 180.
                    </p></dd><dt><span class="term">
                    <code class="constant">GL_CONSTANT_ATTENUATION</code>,
                    <code class="constant">GL_LINEAR_ATTENUATION</code>,
                    <code class="constant">GL_QUADRATIC_ATTENUATION</code>
                </span></dt><dd><p><em class="parameter"><code>params</code></em>
                    returns a single fixed-point or floating-point value that
                    specifies one of the three light attenuation factors.
                    Fixed-point and floating-point values are mapped
                    directly. Only nonnegative values are accepted. If the
                    light is positional, rather than directional, its
                    intensity is attenuated by the reciprocal of the sum of
                    the constant factor, the linear factor times the distance
                    between the light and the vertex being lighted, and the
                    quadratic factor times the square of the same distance.
                    The initial attenuation factors are (1, 0, 0).</p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
        It is always the case that
        <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
        <mml:mi>GL_LIGHTi</mml:mi><mml:mo>=</mml:mo>
        <mml:mi>GL_LIGHT0</mml:mi><mml:mo>+</mml:mo><code class="constant">i</code>.
        </mml:math>
        </p><p>
        If an error is generated, no change is made to the contents
        of <em class="parameter"><code>params</code></em>.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
        <code class="constant">GL_INVALID_ENUM</code> is generated if
        <em class="parameter"><code>light</code></em> or <em class="parameter"><code>pname</code></em>
        is not an accepted value.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
        <a class="citerefentry" href="glLight.xml"><span class="citerefentry"><span class="refentrytitle">glLight</span></span></a>
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="copyright"></a><h2>Copyright</h2><p>
            Copyright <span class="trademark"></span>© 2003-2004
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
        </p></div></div></body></html>
