Unable to clear screen using glClear
-
I have an opengl widget based on QGLWidget inside the mainwindow of an app which I'm using to draw some wireframe models. The models draw just fine, except that the call to glClear is being ignored. I'm stuck with a black background in the widget and a mess of lines resulting from the frame buffer not being cleared. I've placed the glClear call in paintGL, initializeGL, and in my drawing routines. It has no effect anywhere. PaintGL is being called on mouse move events. I'm using the Qt 4.8.5 libraries on a Linux system. Any idea why it won't clear the widget?
BTW, the call I'm using is glClear(GL_COLOR_BUFFER_BIT || GL_DEPTH_BUFFER_BIT);