problems with light

i have a DL in my display routine that draws a terrain. i dont know whatz happened all of a sudden, whenever i run the program, the scene is rendered with the light on for a couple of seconds and then goes off(light). where am i goin wrong?

Originally posted by mithun_daa:
i have a DL in my display routine that draws a terrain. i dont know whatz happened all of a sudden, whenever i run the program, the scene is rendered with the light on for a couple of seconds and then goes off(light). where am i goin wrong?

now my scene starts off with the lights of. only when i rotate the scene, the lights r turned on. this is been happening since i included textures in my project.
thank u.

Sorry, please remember that this is the advanced forum. Your question doesn’t really look like it qualifies to be posted here.
Sit down with the OpenGL redbook and a debugger. Go through your code and understand what you’re doing before asking people to guess.

One thing that I find useful is to start out each scene render pass by slamming all the render states to known values. That provides some amount of consistency in the pipe, should I (ahem) forget to set some state.

The defaults should typically be the least useful possible; i e lime green color, black material, etc. That way, you’ll notice things you forget to set very quickly.