59 glDisable( GL_LIGHT0+
i );
74 glEnable( GL_LIGHT0+
i );
100 memcpy( this->vect, &vect,
sizeof (
float)*3 );
101 memcpy( this->diffuse, &diffuse,
sizeof (
float)*4 );
102 memcpy( this->specular, &specular,
sizeof (
float)*4 );
103 memcpy( this->ambient, &ambient,
sizeof (
float)*4 );
104 memcpy( this->attenuate, &attenuate,
sizeof (
float)*3 );
105 memcpy( this->direction, &direction,
sizeof (this->direction) );
128 return (attenuate[0] != 1) || (attenuate[1] != 0) || (attenuate[2] != 0);
143 diffuse[0] = color.
r;
144 diffuse[1] = color.
g;
145 diffuse[2] = color.
b;
146 diffuse[3] = color.
a;
149 specular[0] = color.
r;
150 specular[1] = color.
g;
151 specular[2] = color.
b;
152 specular[3] = color.
a;
155 ambient[0] = color.
r;
156 ambient[1] = color.
g;
157 ambient[2] = color.
b;
158 ambient[3] = color.
a;
166 attenuate[0] = color.
r;
167 attenuate[1] = color.
g;
168 attenuate[2] = color.
b;
238 #if !defined (_WIN32) && !defined (__CYGWIN__)
240 glLightModeli( GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR );
242 glLightModeli( GL_LIGHT_MODEL_COLOR_CONTROL, GL_SINGLE_COLOR );
259 float tmp[4] = {amb.
r, amb.
g, amb.
b, amb.
a};
260 glLightModelfv( GL_LIGHT_MODEL_AMBIENT, tmp );
274 for (light = 0; light < static_cast<int>(
_llights->size()); light++)
275 if ( (*
_llights)[light].Target() == -2 )
277 if ( light == static_cast<int>(
_llights->size()) )
279 return (*
_llights)[light].Create( templatecopy, global );
284 (*_llights)[light].Kill();
289 if ( (*
_llights)[light].Target() == -2 )
291 (*_llights)[light].ResetProperties( lt, color );
298 assert( light >= 0 && light <= static_cast<int>(
_llights->size()) );
300 if ( (*
_llights)[light].Target() == -2 )
302 (*_llights)[light].Enable();
308 assert( light >= 0 && light <= static_cast<int>(
_llights->size()) );
309 if ( (*
_llights)[light].Target() == -2 )
311 (*_llights)[light].Disable();
344 glLightModelfv( GL_LIGHT_MODEL_AMBIENT, (GLfloat*) &(
_ambient_light[con_number]) );
346 for (i = 0; i <
_llights->size(); i++)
350 if ( (*
_llights)[i].LocalLight() ) {
351 (*_llights)[i].AddToTable();
353 GLLights[GLLindex].
index = -1;
354 (*_llights)[i].ClobberGLLight( GLLindex );
359 GLLights[GLLindex].
index = -1;
361 glDisable( GL_LIGHT0+GLLindex );
375 glLightModeli( GL_LIGHT_MODEL_LOCAL_VIEWER, 1 );
381 GLLights[i].
index = -1;
384 static float lightoptimalintensity =
388 static bool separatespecularcolor =