i want my app to be able to render with a variable number of lights, and up to the maximum number allowed by a particular implementation. but how can i set or unset lights using glLight* calls if the light number (eg LIGHT0 etc) has to be hardcoded into the code, whilst at the same time i don’t know at compile time how many lights will be available?
The OpenGL specs states that:
And GL_LIGHT0 is the same for all OpenGL implementation.
It should solve your problem !