Me and lights dont get along

I have created an OpenGL program with 50 rotating cubes and a camera so you can move around the scene.I want to lights but they won’t work. Please tell me what im doing wrong. The source code code can be found at:

Just click the white page to download.

Thanks in advance.

I have tried out your code. I had to zoom out and move until the objects were in view. Can you clarify what about the lights don’t work?

You need to move the init() function call AFTER the call to glutEnterGameMode.

This is because glutEnterGameMode creates it’s own window, and this window has it’s own state associated with it. So, your previous glEnable statements did not affect this window.


Thank you guys.
Moving the Init() function after glutEnterGameMode solve the problem.