different behavior during the resizing of window


I made this code, just to test openGL:

glLightfv(GL_LIGHT0, GL_AMBIENT, red);
glLightfv(GL_LIGHT0, GL_AMBIENT, green);

All the objects (A, B, C, D) are green!!!
However, when I am resizing my window, A, B, C are red and D is green!

Somedy can tell me what is the standard behavior? (everything green or just D green)

Somebody has an idea of what is wrong when there isn’t the right behavior?


Hardly enough detail here, but I suspect a bit hint lies at looking at the code in your resize callback.

See this for ideas.


Standard behaviour would be ABC red, D Green. I would guess your resize callback is actually correct (since your program works correctly after a resize), but your initialization code is wrong in some way. As a check try calling the resize code as a final call during initialization.