Under Windows 7, I’m drawing the same model in two different OpenGL windows. I’m setting up each window using the following code:
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STENCIL); glutInitWindowSize (1000, 760); glutInitWindowPosition (10, 0); window2 = glutCreateWindow ("title"); glEnable (GL_DEPTH_TEST); glEnable (GL_LIGHTING); glEnable (GL_LIGHT0); glEnable (GL_NORMALIZE); glClearColor (bg, bg, bg, 1.0f); tmp = tmp = tmp = amb; tmp = 1.f; glLightfv (which, GL_AMBIENT, tmp); tmp = tmp = tmp = spec; tmp = 1.f; glLightfv (which, GL_SPECULAR, tmp); tmp = tmp = tmp = brt; tmp = 1.f; glLightfv (which, GL_DIFFUSE, tmp); glLightfv (which, GL_POSITION, pos);
Whereas the model is drawn using
the correct color (white) in the first window,
in the second window it is initially darker–
gray. Eventually it becomes partly white
and then fully white. My draw_scene function
uses the same global model color whether
drawing in the first or second window.
Does anybody have any idea what might cause this?