Lighting Question

In gl.h, there is a constant GL_MAX_LIGHTS and it’s a hex number. The same number in decimal is 3377. Is that right? Can I have 3377 light sources?

Not quite. Use glGetIntegerv() to query the OpenGL state machine and print the result, and you’ll see the maximum number of lights is actually much lower. :slight_smile:

#define GL_MAX_LIGHTS 0x0D31

it means that the maximum number of lights is the integer at the adress 0x0D31. it’s just a pointer!

With 3377 lights, I’ll be able to build a big night club :smiley:

Pointers? That sounds like “Peeks and pokes for OpenGL”. :wink:
The GL_ defines are the GLenum values you use in most OpenGL commands. They are by no means pointers, just values.

I know it’s not a pointer. But, for example, GL_EXP2,GL_CCW or GL_TRIANGLES are just some constants used in switch statement.

GL_MAX_LIGHT refers to an intern pointer. I kwow it’s not THE real pointer but it refers to a pointer. That is why you must call the function glGet…

Sorry if my answer wasn’t clair and if I’m in a mist, thank you for correcting me :wink:

Good programming!!!