<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:mml="http://www.w3.org/1998/Math/MathML"
><head><title>glGetLight</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.59.1"/><link rel="home" href="index.xml" title="PyOpenGL 2.0.1.07 Man Pages"/><link rel="up" href="reference-GL.xml" title="GL"/><link rel="previous" href="glGetHistogramParameter.3G.xml" title="glGetHistogramParameter"/><link rel="next" href="glGetMap.3G.xml" title="glGetMap"/></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">glGetLight</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glGetHistogramParameter.3G.xml">Prev</a> </td><th width="60%" align="center">GL</th><td width="20%" align="right"> <a accesskey="n" href="glGetMap.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glGetLight.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glGetLight.3G-name"/><h2>Name</h2><p>glGetLightfv, glGetLightiv &#8212; return light source parameter values</p></div><div class="refsynopsisdiv"><a name="glGetLight.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>glGetLightfv</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum <i><tt>light</tt></i>, GLenum <i><tt>pname</tt></i>, GLfloat *<i><tt>params</tt></i>);</code></td></tr><tr><td valign="top"><code>void <tt>glGetLightiv</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum <i><tt>light</tt></i>, GLenum <i><tt>pname</tt></i>, GLint *<i><tt>params</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glGetLight.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glGetLightfv</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>light</tt></i>, <i><tt>pname</tt></i>) &#8594; <i><tt>params</tt></i></code></td></tr><tr><td valign="top"><code><tt>glGetLightiv</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>light</tt></i>, <i><tt>pname</tt></i>) &#8594; <i><tt>params</tt></i></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glGetLight.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>light</tt></i></span></dt><dd>
						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
						<tt>GL_LIGHT</tt><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mi>i</mml:mi>
							</mml:math> where 0 &#8804; <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mi>i</mml:mi>
							</mml:math> &lt; <tt>GL_MAX_LIGHTS</tt>.
					</dd><dt><span class="term"><i><tt>pname</tt></i></span></dt><dd>
						Specifies a light source parameter for <i><tt>light</tt></i>. Accepted symbolic names are
						<tt>GL_AMBIENT</tt>, <tt>GL_DIFFUSE</tt>, <tt>GL_SPECULAR</tt>,
						<tt>GL_POSITION</tt>, <tt>GL_SPOT_DIRECTION</tt>,
						<tt>GL_SPOT_EXPONENT</tt>, <tt>GL_SPOT_CUTOFF</tt>,
						<tt>GL_CONSTANT_ATTENUATION</tt>, <tt>GL_LINEAR_ATTENUATION</tt>, and
						<tt>GL_QUADRATIC_ATTENUATION</tt>.
					</dd><dt><span class="term"><i><tt>params</tt></i></span></dt><dd>
						Returns the requested data.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glGetLight.3G-description"/><h2>Description</h2><p>
			<tt>glGetLight</tt> returns in <i><tt>params</tt></i> the value or values of a
			light source parameter. <i><tt>light</tt></i> names the light and is a symbolic name of the form
			<tt>GL_LIGHT</tt><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>i</mml:mi>
				</mml:math> for 0 &#8804; <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>i</mml:mi>
				</mml:math> &lt; <tt>GL_MAX_LIGHTS</tt>, where <tt>GL_MAX_LIGHTS</tt> is an
			implementation dependent constant that is greater than or equal to eight. <i><tt>pname</tt></i> specifies one of
			ten light source parameters, again by symbolic name.
		</p><p>
			The following parameters are defined:
		</p><div class="variablelist"><dl><dt><span class="term"><tt>GL_AMBIENT</tt></span></dt><dd>
						<i><tt>params</tt></i> returns four integer or floating-point values representing the ambient
						intensity of the light source. Integer values, when requested, are linearly mapped from the internal
						floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0
						maps to the most negative representable integer value. If the internal value is outside the range [-1, 1],
						the corresponding integer return value is undefined. The initial value is (0, 0, 0, 1).
					</dd><dt><span class="term"><tt>GL_DIFFUSE</tt></span></dt><dd>
						<i><tt>params</tt></i> returns four integer or floating-point values representing the diffuse
						intensity of the light source. Integer values, when requested, are linearly mapped from the internal
						floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0
						maps to the most negative representable integer value. If the internal value is outside the range [-1, 1],
						the corresponding integer return value is undefined. The initial value for <tt>GL_LIGHT0</tt>
						is (1, 1, 1, 1); for other lights, the initial value is (0, 0, 0, 0).
					</dd><dt><span class="term"><tt>GL_SPECULAR</tt></span></dt><dd>
						<i><tt>params</tt></i> returns four integer or floating-point values representing the specular
						intensity of the light source. Integer values, when requested, are linearly mapped from the internal
						floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0
						maps to the most negative representable integer value. If the internal value is outside the range [-1, 1],
						the corresponding integer return value is undefined. The initial value for <tt>GL_LIGHT0</tt>
						is (1, 1, 1, 1); for other lights, the initial value is (0, 0, 0, 0).
					</dd><dt><span class="term"><tt>GL_POSITION</tt></span></dt><dd>
						<i><tt>params</tt></i> returns four integer or floating-point values representing the position of
						the light source. Integer values, when requested, are computed by rounding the internal floating-point
						values to the nearest integer value. The returned values are those maintained in eye coordinates. They will
						not be equal to the values specified using <tt>glLight</tt>, unless the
						modelview matrix was identity at the time <tt>glLight</tt> was called. The
						initial value is (0, 0, 1, 0).
					</dd><dt><span class="term"><tt>GL_SPOT_DIRECTION</tt></span></dt><dd>
						<i><tt>params</tt></i> returns three integer or floating-point values representing the direction of
						the light source. Integer values, when requested, are computed by rounding the internal floating-point
						values to the nearest integer value. The returned values are those maintained in eye coordinates. They will
						not be equal to the values specified using <tt>glLight</tt>, unless the
						modelview matrix was identity at the time <tt>glLight</tt> was called.
						Although spot direction is normalized before being used in the lighting equation, the returned values are
						the transformed versions of the specified values prior to normalization. The initial value is (0, 0, -1).
					</dd><dt><span class="term"><tt>GL_SPOT_EXPONENT</tt></span></dt><dd>
						<i><tt>params</tt></i> returns a single integer or floating-point value representing the spot
						exponent of the light. An integer value, when requested, is computed by rounding the internal
						floating-point representation to the nearest integer. The initial value is 0.
					</dd><dt><span class="term"><tt>GL_SPOT_CUTOFF</tt></span></dt><dd>
						<i><tt>params</tt></i> returns a single integer or floating-point value representing the spot cutoff
						angle of the light. An integer value, when requested, is computed by rounding the internal floating-point
						representation to the nearest integer. The initial value is 180.
					</dd><dt><span class="term"><tt>GL_CONSTANT_ATTENUATION</tt></span></dt><dd>
						<i><tt>params</tt></i> returns a single integer or floating-point value representing the constant
						(not distance-related) attenuation of the light. An integer value, when requested, is computed by rounding
						the internal floating-point representation to the nearest integer. The initial value is 1.
					</dd><dt><span class="term"><tt>GL_LINEAR_ATTENUATION</tt></span></dt><dd>
						<i><tt>params</tt></i> returns a single integer or floating-point value representing the linear
						attenuation of the light. An integer value, when requested, is computed by rounding the internal
						floating-point representation to the nearest integer. The initial value is 0.
					</dd><dt><span class="term"><tt>GL_QUADRATIC_ATTENUATION</tt></span></dt><dd>
						<i><tt>params</tt></i> returns a single integer or floating-point value representing the quadratic
						attenuation of the light. An integer value, when requested, is computed by rounding the internal
						floating-point representation to the nearest integer. The initial value is 0.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glGetLight.3G-notes"/><h2>Notes</h2><p>
			It is always the case that <tt>GL_LIGHT</tt><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>i</mml:mi>
				</mml:math> = <tt>GL_LIGHT0</tt> + <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mi>i</mml:mi>
				</mml:math>.
		</p><p>
			If an error is generated, no change is made to the contents of <i><tt>params</tt></i>.
		</p></div><div class="refsect1" lang="en"><a name="glGetLight.3G-errors"/><h2>Errors</h2><p>
			<tt>GL_INVALID_ENUM</tt> is generated if <i><tt>light</tt></i> or <i><tt>pname</tt></i> is
			not an accepted value.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glGetLight</tt> is
			executed between the execution of <a href="glBegin.3G.xml"><tt>glBegin</tt></a> and the corresponding execution of
			<a href="glBegin.3G.xml"><tt>glEnd</tt></a>.
		</p></div><div class="refsect1" lang="en"><a name="glGetLight.3G-see_also"/><h2>See Also</h2><p>
			<span class="simplelist"><a href="glLight.3G.xml">glLight</a></span>
		</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="glGetHistogramParameter.3G.xml">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-GL.xml">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="glGetMap.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glGetHistogramParameter </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glGetMap</td></tr></table></div></body></html>
