fb16.put(pos.x).put(pos.y).put(pos.z).put(0.0f).flip();
glLight(glLightIndex, GL_POSITION, fb16);
glLightf(glLightIndex, GL_SPOT_CUTOFF, 180);
break;
case Point:
PointLight pLight = (PointLight) light;
fb16.clear();
fb16.put(col.r).put(col.g).put(col.b).put(col.a).flip();
glLight(glLightIndex, GL_DIFFUSE, fb16);
glLight(glLightIndex, GL_SPECULAR, fb16);
pos = pLight.getPosition();
fb16.clear();
fb16.put(pos.x).put(pos.y).put(pos.z).put(1.0f).flip();
glLight(glLightIndex, GL_POSITION, fb16);
glLightf(glLightIndex, GL_SPOT_CUTOFF, 180);
if (pLight.getRadius() > 0) {
// Note: this doesn't follow the same attenuation model
// as the one used in the lighting shader.
glLightf(glLightIndex, GL_CONSTANT_ATTENUATION, 1);
glLightf(glLightIndex, GL_LINEAR_ATTENUATION, pLight.getInvRadius() * 2);
glLightf(glLightIndex, GL_QUADRATIC_ATTENUATION, pLight.getInvRadius() * pLight.getInvRadius());
}else{
glLightf(glLightIndex, GL_CONSTANT_ATTENUATION, 1);
glLightf(glLightIndex, GL_LINEAR_ATTENUATION, 0);
glLightf(glLightIndex, GL_QUADRATIC_ATTENUATION, 0);
}