glLight
| Definition: |
include pGUI.e
include opengl.e glLight(integer light, integer pname, object params) |
||||||||||||||||||
| Description: |
Deprecated, specifically not supported on WebGL. While still supported on desktop/Phix, this routine has been coloured illegal to indicate it cannot be handled by pwa/p2js. The glLight function sets the light source parameter values. light: The identifier of a light. 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 GL_LIGHTi where i is a value: 0 to GL_MAX_LIGHTS - 1. pname: A light source parameter for light. See the Remarks section for possible values. params: Specifies the value or values that parameter pname of light source light will be set to. |
||||||||||||||||||
| pwa/p2js: | Not supported. | ||||||||||||||||||
| Remarks |
If light or pname was not an accepted value, glGetError() will return GL_INVALID_ENUM. If a spot exponent value was specified outside the range [0, 128], or spot cutoff was specified outside the range [0, 90] (except for the special value 180), or a negative attenuation factor was specified, glGetError() will return GL_INVALID_VALUE. If glLight() is called between glBegin() and glEnd(), glGetError() will return GL_INVALID_OPERATION. Internally, glLight() invokes the C function glLightf when params is an atom, and glLightfv when params is a sequence. It does not validate whether params is an atom or sequence of the correct length against the setting of pname. The C functions glLighti and glLightiv are not wrapped, since params can be an integer, a float, a sequence of integer, a sequence of float, or even a sequence containing a mixture of integer and float. Obviously testing whether it is safe to invoke the int functions would be far more expensive than just always using the float versions, that is as far as opengl.e is concerned. Some care may be necessary when translating C code, to ensure that params is not a memory address. All four C functions just mentioned are syntax coloured illegal, and should be changed to a plain glLight after any required changes to the final "params" parameter setting. The glLight function sets the value or values of individual light source parameters. The light parameter names the light and is a symbolic name of the form GL_LIGHTi, where 0 <= i < GL_MAX_LIGHTS. The pname parameter specifies one of the light source parameters, again by symbolic name (as defined in opengl.e):
The params parameter is either a single value or a sequence that contains the new values. Lighting calculation is enabled and disabled using glEnable and glDisable with argument GL_LIGHTING. When lighting is enabled, light sources that are enabled contribute to the lighting calculation. Light source i is enabled and disabled using glEnable and glDisable with argument GL_LIGHTi. It is always the case that GL_LIGHTi = GL_LIGHT0 + i. The following functions retrieve information related to the glLight function: glGetLight glIsEnabled with argument GL_LIGHTING |
||||||||||||||||||
| See Also: |
glBegin,
glEnd,
xor_bits,
glGetError,
not_bits,
int_to_bits
DEV See also //glBegin glColorMaterial //glEnd glLightModel glMaterial |