_C_ License Applicability. Except to the extent portions of this file are
_C_ made subject to an alternative license as permitted in the SGI Free
_C_ Software License B, Version 1.1 (the "License"), the contents of this
_C_ file are subject only to the provisions of the License. You may not use
_C_ this file except in compliance with the License. You may obtain a copy
_C_ of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
_C_ Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
_C_ 
_C_ http://oss.sgi.com/projects/FreeB
_C_ 
_C_ Note that, as provided in the License, the Software is distributed on an
_C_ "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
_C_ DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
_C_ CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
_C_ PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
_C_ 
_C_ Original Code. The Original Code is: OpenGL Sample Implementation,
_C_ Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
_C_ Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
_C_ Copyright in any portions created by third parties is as indicated
_C_ elsewhere herein. All Rights Reserved.
_C_ 
_C_ Additional Notice Provisions: The application programming interfaces
_C_ established by SGI in conjunction with the Original Code are The
_C_ OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
_C_ April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
_C_ 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
_C_ Window System(R) (Version 1.3), released October 19, 1998. This software
_C_ was created using the OpenGL(R) version 1.2.1 Sample Implementation
_C_ published by SGI, but has not been independently verified as being
_C_ compliant with the OpenGL(R) version 1.2.1 Specification.
_C_
_C_ $Date$ $Revision$
_C_ The first character in this file must be an '_'!
_C_ Anything on a line after _C_ is ignored
_define(_filters,tbl|eqn)_C_
_C_      eqn is automatically replaced with neqn for nroff
_header(GetLight,return light source parameter values)
_names(GetLight,[fi]v)
.EQ
delim $$
.EN
.SH PARAMETERS
_phead(_param1)
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 _const(LIGHT)$i$
where 0 \(<= $ i $ < _const(MAX_LIGHTS).
_phead(_param2)
Specifies a light source parameter for _param1.
Accepted symbolic names are
_const(AMBIENT),
_const(DIFFUSE),
_const(SPECULAR),
_const(POSITION),
_const(SPOT_DIRECTION),
_const(SPOT_EXPONENT),
_const(SPOT_CUTOFF),
_const(CONSTANT_ATTENUATION),
_const(LINEAR_ATTENUATION), and
_const(QUADRATIC_ATTENUATION).
_phead(_param3)
Returns the requested data.
.SH DESCRIPTION
_cmnd returns in _param3 the value or values of a light source parameter.
_param1 names the light and is a symbolic name of the form _const(LIGHT)$i$
for 0 \(<= $i$ < _const(MAX_LIGHTS),
where _const(MAX_LIGHTS) is an implementation dependent constant that is
greater than or equal to eight.
_param2 specifies one of ten light source parameters,
again by symbolic name.
.P
The following parameters are defined:
.TP 20
_const(AMBIENT)
_param3 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). 
.TP
_const(DIFFUSE)
_param3 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 _const(LIGHT0) is (1, 1, 1, 1); for other lights, the
initial value is (0, 0, 0, 0). 
.TP
_const(SPECULAR)
_param3 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 _const(LIGHT0) is (1, 1, 1, 1); for other lights, the
initial value is (0, 0, 0, 0).
.TP
_const(POSITION)
_param3 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 _cmnd(Light),
unless the modelview matrix was identity at the time _cmnd(Light) was
called. The initial value is (0, 0, 1, 0).
.TP
_const(SPOT_DIRECTION)
_param3 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 _cmnd(Light),
unless the modelview matrix was identity at the time _cmnd(Light) 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).
.TP
_const(SPOT_EXPONENT)
_param3 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. 
.TP
_const(SPOT_CUTOFF)
_param3 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. 
.TP
_const(CONSTANT_ATTENUATION)
_param3 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. 
.TP
_const(LINEAR_ATTENUATION )
_param3 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. 
.TP
_const(QUADRATIC_ATTENUATION)
_param3 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. 
.SH NOTES
It is always the case that _const(LIGHT)$i$ = _const(LIGHT0) + $i$.
.P
If an error is generated,
no change is made to the contents of _param3.
.SH ERRORS
_const(INVALID_ENUM) is generated if _param1 or _param2 is not an
accepted value.
.P
_const(INVALID_OPERATION) is generated if _cmnd
is executed between the execution of _cmnd(Begin)
and the corresponding execution of _cmnd(End).
.SH SEE ALSO
_cmnd(Light)
