Skip to content

Commit 73b659e

Browse files
committed
clear buffers at the right place
1 parent 653099d commit 73b659e

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

code/3rd_party/3rd_QGLViewer/QGLViewer/qglviewer.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -270,15 +270,6 @@ void QGLViewer::initializeGL() {
270270
setForegroundColor(QColor(180, 180, 180));
271271
setBackgroundColor(QColor(51, 51, 51));
272272

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-
282273
// Calls user defined method. Default emits a signal.
283274
init();
284275

@@ -295,6 +286,15 @@ camera in the world coordinate system. \arg draw() (or fastDraw() when the
295286
camera is manipulated) : main drawing method. Should be overloaded. \arg
296287
postDraw() : display of visual hints (world axis, FPS...) */
297288
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+
298298
if (displaysInStereo()) {
299299
for (int view = 1; view >= 0; --view) {
300300
// Clears screen, set model view matrix with shifted matrix for ith buffer

code/City3D/paint_canvas.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ void PaintCanvas::init()
181181

182182

183183
void PaintCanvas::draw() {
184+
ogf_check_gl;
185+
184186
if (point_set_ && show_point_set_ && point_set_render_)
185187
point_set_render_->draw(point_set_);
186188

0 commit comments

Comments
 (0)