Hello,

After hours of tests to understand how it works I need help...

I tried to test the colors of the lights and materials but I waste my time : my results change with the order of the calls of the opengl functions...

For example this order :
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
define GL_LIGHT_MODEL_AMBIENT and light0
glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
glEnable(GL_COLOR_MATERIAL);
glColor4f(...);
define geometry
render


If I move glEnable(GL_LIGHTING); from the begining after the definition of the geometry I obtain a very different result.
I tested that because I have read in a forum that glColor must be called before enabling the lighting. But I did not read any things like this in the opengl documentation.

So what is the correct order of the calls ?

Thanks in advance.