Im draws a simple scene with Open GL. Ive subclassed QGLWidget and redefined paintGL (). Nothing special:
void CGLWidget::paintGL() { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); gluLookAt (120.0, 160.0, -300.0, 0.0 + 120.0, 0.0 + 160.0, 2.0 - 300.0, 0.0, 1.0, 0.0); glScalef(1.0f/300.0f, 1.0f/300.0f, 1.0f/300.0f); glClear(GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluPerspective(80.0, width()/(double)height(), 5.0, 100000.0); glMatrixMode(GL_MODELVIEW); glBegin(GL_POINTS); glColor3f(1.0f,0.6f,0.0f); glVertex3d(x, y, z);
I have a timer in the main window that calls updateGL() GL widgets. Ive confirmed that this leads to a call to paintGL() . However, the actual image on the screen is updated very rarely. Even if you resize the window, the scene does not update. Why is this and how can I get it to update?
source share