Esempio n. 1
0
void GLLight::setCurrentGL(const int id)
{
	GLenum gl_light_id=GL_LIGHT0+id;
	glLightv(gl_light_id,GL_DIFFUSE,diffuse.rgba);
	glLightv(gl_light_id,GL_SPECULAR,specular.rgba);
	glLightv(gl_light_id,GL_POSITION,position);
	glLightf(gl_light_id,GL_QUADRATIC_ATTENUATION,att2);
	glLightf(gl_light_id,GL_LINEAR_ATTENUATION,att2);
	glLightf(gl_light_id,GL_CONSTANT_ATTENUATION,att0);
	glLightv(gl_light_id,GL_SPOT_DIRECTION,spot_direction);
	glLightf(gl_light_id,GL_SPOT_EXPONENT,spot_exponent);
	glLightf(gl_light_id,GL_SPOT_CUTOFF,spot_cutoff);
	glEnable(gl_light_id);
}
Esempio n. 2
0
inline void glLight( const GLenum & light, const GLenum & pname, const QVector4D & v )		{ glLightv( light, pname, reinterpret_cast<const float*>(&v) ); }