Hi all,
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[0], bg[1], bg[2], 1.0f);
tmp[0] = tmp[1] = tmp[2] = amb;
tmp[3] = 1.f;
glLightfv (which, GL_AMBIENT, tmp);
tmp[0] = tmp[1] = tmp[2] = spec;
tmp[3] = 1.f;
glLightfv (which, GL_SPECULAR, tmp);
tmp[0] = tmp[1] = tmp[2] = brt;
tmp[3] = 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?
Thanks.