Skip to content

Commit

Permalink
clear buffers at the right place
Browse files Browse the repository at this point in the history
  • Loading branch information
LiangliangNan committed Jan 17, 2025
1 parent 653099d commit 73b659e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 9 additions & 9 deletions code/3rd_party/3rd_QGLViewer/QGLViewer/qglviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,6 @@ void QGLViewer::initializeGL() {
setForegroundColor(QColor(180, 180, 180));
setBackgroundColor(QColor(51, 51, 51));

// Clear the buffer where we're going to draw
if (format().stereo()) {
glDrawBuffer(GL_BACK_RIGHT);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDrawBuffer(GL_BACK_LEFT);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
} else
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

// Calls user defined method. Default emits a signal.
init();

Expand All @@ -295,6 +286,15 @@ camera in the world coordinate system. \arg draw() (or fastDraw() when the
camera is manipulated) : main drawing method. Should be overloaded. \arg
postDraw() : display of visual hints (world axis, FPS...) */
void QGLViewer::paintGL() {
// Clear the buffer where we're going to draw
if (format().stereo()) {
glDrawBuffer(GL_BACK_RIGHT);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDrawBuffer(GL_BACK_LEFT);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
} else
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

if (displaysInStereo()) {
for (int view = 1; view >= 0; --view) {
// Clears screen, set model view matrix with shifted matrix for ith buffer
Expand Down
2 changes: 2 additions & 0 deletions code/City3D/paint_canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ void PaintCanvas::init()


void PaintCanvas::draw() {
ogf_check_gl;

if (point_set_ && show_point_set_ && point_set_render_)
point_set_render_->draw(point_set_);

Expand Down

0 comments on commit 73b659e

Please sign in to comment.