View Full Version : How to loop though all OpenGL lights ?

03-08-2001, 01:22 AM
How can I loop through all the lights that I have defined ?

I need something like this:
for (light = 0, light <= max_light, light++)

The Problem is that OpenGL uses the enum const GL_LIGHT0, GL_LIGHT1 and so on. And I can not rely on that GL_LIGHT1 = GL_LIGHT0 + 1

03-08-2001, 01:57 AM
The specifications says thay GL_LIGHTn is identical to GL_LIGHT0 + n. So you can do like that to loop through all lights.

03-08-2001, 02:53 AM
Hey that's great. That will make it quite comfortable. Thank you for clarifying this.