1GLGETLIGHT(3G)                   OpenGL Manual                  GLGETLIGHT(3G)
2
3
4

NAME

6       glGetLight - return light source parameter values
7

C SPECIFICATION

9       void glGetLightfv(GLenum light, GLenum pname, GLfloat * params);
10
11       void glGetLightiv(GLenum light, GLenum pname, GLint * params);
12

PARAMETERS

14       light
15           Specifies a light source. The number of possible lights depends on
16           the implementation, but at least eight lights are supported. They
17           are identified by symbolic names of the form GL_LIGHT i where i
18           ranges from 0 to the value of GL_MAX_LIGHTS - 1.
19
20       pname
21           Specifies a light source parameter for light. Accepted symbolic
22           names are GL_AMBIENT, GL_DIFFUSE, GL_SPECULAR, GL_POSITION,
23           GL_SPOT_DIRECTION, GL_SPOT_EXPONENT, GL_SPOT_CUTOFF,
24           GL_CONSTANT_ATTENUATION, GL_LINEAR_ATTENUATION, and
25           GL_QUADRATIC_ATTENUATION.
26
27       params
28           Returns the requested data.
29

DESCRIPTION

31       glGetLight returns in params the value or values of a light source
32       parameter.  light names the light and is a symbolic name of the form
33       GL_LIGHT i where i ranges from 0 to the value of GL_MAX_LIGHTS - 1.
34       GL_MAX_LIGHTS is an implementation dependent constant that is greater
35       than or equal to eight.  pname specifies one of ten light source
36       parameters, again by symbolic name.
37
38       The following parameters are defined:
39
40       GL_AMBIENT
41           params returns four integer or floating-point values representing
42           the ambient intensity of the light source. Integer values, when
43           requested, are linearly mapped from the internal floating-point
44           representation such that 1.0 maps to the most positive
45           representable integer value, and -1.0 maps to the most negative
46           representable integer value. If the internal value is outside the
47           range -1 1, the corresponding integer return value is undefined.
48           The initial value is (0, 0, 0, 1).
49
50       GL_DIFFUSE
51           params returns four integer or floating-point values representing
52           the diffuse intensity of the light source. Integer values, when
53           requested, are linearly mapped from the internal floating-point
54           representation such that 1.0 maps to the most positive
55           representable integer value, and -1.0 maps to the most negative
56           representable integer value. If the internal value is outside the
57           range -1 1, the corresponding integer return value is undefined.
58           The initial value for GL_LIGHT0 is (1, 1, 1, 1); for other lights,
59           the initial value is (0, 0, 0, 0).
60
61       GL_SPECULAR
62           params returns four integer or floating-point values representing
63           the specular intensity of the light source. Integer values, when
64           requested, are linearly mapped from the internal floating-point
65           representation such that 1.0 maps to the most positive
66           representable integer value, and -1.0 maps to the most negative
67           representable integer value. If the internal value is outside the
68           range -1 1, the corresponding integer return value is undefined.
69           The initial value for GL_LIGHT0 is (1, 1, 1, 1); for other lights,
70           the initial value is (0, 0, 0, 0).
71
72       GL_POSITION
73           params returns four integer or floating-point values representing
74           the position of the light source. Integer values, when requested,
75           are computed by rounding the internal floating-point values to the
76           nearest integer value. The returned values are those maintained in
77           eye coordinates. They will not be equal to the values specified
78           using glLight(), unless the modelview matrix was identity at the
79           time glLight() was called. The initial value is (0, 0, 1, 0).
80
81       GL_SPOT_DIRECTION
82           params returns three integer or floating-point values representing
83           the direction of the light source. Integer values, when requested,
84           are computed by rounding the internal floating-point values to the
85           nearest integer value. The returned values are those maintained in
86           eye coordinates. They will not be equal to the values specified
87           using glLight(), unless the modelview matrix was identity at the
88           time glLight() was called. Although spot direction is normalized
89           before being used in the lighting equation, the returned values are
90           the transformed versions of the specified values prior to
91           normalization. The initial value is 0 0 -1.
92
93       GL_SPOT_EXPONENT
94           params returns a single integer or floating-point value
95           representing the spot exponent of the light. An integer value, when
96           requested, is computed by rounding the internal floating-point
97           representation to the nearest integer. The initial value is 0.
98
99       GL_SPOT_CUTOFF
100           params returns a single integer or floating-point value
101           representing the spot cutoff angle of the light. An integer value,
102           when requested, is computed by rounding the internal floating-point
103           representation to the nearest integer. The initial value is 180.
104
105       GL_CONSTANT_ATTENUATION
106           params returns a single integer or floating-point value
107           representing the constant (not distance-related) attenuation of the
108           light. An integer value, when requested, is computed by rounding
109           the internal floating-point representation to the nearest integer.
110           The initial value is 1.
111
112       GL_LINEAR_ATTENUATION
113           params returns a single integer or floating-point value
114           representing the linear attenuation of the light. An integer value,
115           when requested, is computed by rounding the internal floating-point
116           representation to the nearest integer. The initial value is 0.
117
118       GL_QUADRATIC_ATTENUATION
119           params returns a single integer or floating-point value
120           representing the quadratic attenuation of the light. An integer
121           value, when requested, is computed by rounding the internal
122           floating-point representation to the nearest integer. The initial
123           value is 0.
124

NOTES

126       It is always the case that GL_LIGHT i = GL_LIGHT0 + i.
127
128       If an error is generated, no change is made to the contents of params.
129

ERRORS

131       GL_INVALID_ENUM is generated if light or pname is not an accepted
132       value.
133
134       GL_INVALID_OPERATION is generated if glGetLight is executed between the
135       execution of glBegin() and the corresponding execution of glEnd().
136

SEE ALSO

138       glLight()
139
141       Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed
142       under the SGI Free Software B License. For details, see
143       http://oss.sgi.com/projects/FreeB/.
144

AUTHORS

146       opengl.org
147
148
149
150opengl.org                        07/13/2018                    GLGETLIGHT(3G)
Impressum