GL_LIGHTn - sequential?

Just out of interest, is the integer value of GL_LIGHTn guaranteed to be (GL_LIGHT0 + n), or is this behaviour implementation-dependent?

(Not an important question - just my mind wandering again…)

I think there’s only 8 GL_LIGHTn’s, as far as opengl 1.2[?]

going from 0-7. you can play with it and see.
ex: GL_LIGHT8, GL_LIGHT20, etc

can somebody confirm?

-=[ best regards ]=-

Only 8 in the standard, but some cards/platforms do more, as I understand it.


The specification always have the answer to questions like this. Everyone should have a copy. See page 60 in the latest spec.

Just as said bob.

By the way, as the values are defined on gl.h, it can not be implementation dependant.

/* LightName */
#define GL_LIGHT0 0x4000
#define GL_LIGHT1 0x4001
#define GL_LIGHT2 0x4002
#define GL_LIGHT3 0x4003
#define GL_LIGHT4 0x4004
#define GL_LIGHT5 0x4005
#define GL_LIGHT6 0x4006
#define GL_LIGHT7 0x4007