@@ -270,15 +270,6 @@ void QGLViewer::initializeGL() {
270
270
setForegroundColor (QColor (180 , 180 , 180 ));
271
271
setBackgroundColor (QColor (51 , 51 , 51 ));
272
272
273
- // Clear the buffer where we're going to draw
274
- if (format ().stereo ()) {
275
- glDrawBuffer (GL_BACK_RIGHT);
276
- glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
277
- glDrawBuffer (GL_BACK_LEFT);
278
- glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
279
- } else
280
- glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
281
-
282
273
// Calls user defined method. Default emits a signal.
283
274
init ();
284
275
@@ -295,6 +286,15 @@ camera in the world coordinate system. \arg draw() (or fastDraw() when the
295
286
camera is manipulated) : main drawing method. Should be overloaded. \arg
296
287
postDraw() : display of visual hints (world axis, FPS...) */
297
288
void QGLViewer::paintGL () {
289
+ // Clear the buffer where we're going to draw
290
+ if (format ().stereo ()) {
291
+ glDrawBuffer (GL_BACK_RIGHT);
292
+ glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
293
+ glDrawBuffer (GL_BACK_LEFT);
294
+ glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
295
+ } else
296
+ glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
297
+
298
298
if (displaysInStereo ()) {
299
299
for (int view = 1 ; view >= 0 ; --view) {
300
300
// Clears screen, set model view matrix with shifted matrix for ith buffer
0 commit comments