Lights

Im using OpenGL in windows NT. I have a peculiar problem.

I have 3 lights.
Light 1: position - A, color - a
Light 2: position - B, color - b
Light 3: position - C, color - c

Initially I have all of them enabled. Now I disable Light 1. I expected only Light 1 go off and others behave as before.

But what I got was Light 2 in position A, color b and Light 3 in position B, color c.

Anybody have an answer for this?

It’s either a bug in your code or a bug in the driver. It is probably unlikely that this is a bug in the driver.

The tokens to position lights and glEnable & glDisable lights are the same identifying tokens, it would be difficult to confuse these. GL_LIGHT0, GL_LIGHT1 and GL_LIGHT2 in your case.

Make sure that your glEnable glDisable and glLight* calls all use consistent tokens, specifically that glDisable disables with the token GL_LIGHT0.

Also ensure that glLight* calls for position and color use the right tokens, obvious but then again for a bug like this you need to be pedantic.

Actually I setup light properties only once. After that I only enable or disable them. No further calls to change the light property.