PDA

View Full Version : help on openGL context



mickey
29th March 2006, 16:29
Hi, I've got a problem. In some case my app update the openGL context calling initalizeGL;
that's ok; but I see that in this case, the light seems fall down; my background white lines appear more dark; I see that I increment y value of light position up to 4 or 5, the lines appear more white (I think this ok), and when openGL context is update, the light don't fall down; Any hints?


//initializeGL()
GLfloat light_position[] = {0.0, 0.0, 2.0, 0.0};
glLightfv(GL_LIGHT0, GL_POSITION, light_position);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_NORMALIZE);

mickey
29th March 2006, 19:21
Sorry I thought was a context problem; the light position is affect by MODELVIEW trasformation and some glTraslate changed the light position; Thanks