Skip to content

Commit

Permalink
works with Qt6
Browse files Browse the repository at this point in the history
  • Loading branch information
LiangliangNan committed Dec 14, 2024
1 parent 48d07d9 commit 6fcda7f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
1 change: 0 additions & 1 deletion code/3rd_QGLViewer/QGLViewer/qglviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ void QGLViewer::initializeGL() {
glEnable(GL_LIGHTING);
glEnable(GL_DEPTH_TEST);
glEnable(GL_COLOR_MATERIAL);
glEnable(GL_CULL_FACE);

// Default colors
setForegroundColor(QColor(180, 180, 180));
Expand Down
15 changes: 5 additions & 10 deletions code/PolyFit/paint_canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ void PaintCanvas::init()
setFPSIsDisplayed(false);
}


void PaintCanvas::draw() {
if (fatal_opengl_error) {
return;
Expand Down Expand Up @@ -251,6 +250,11 @@ void PaintCanvas::draw() {
drawText(30, 180, " - Pan: right button", font);
drawText(30, 210, " - Zoom: wheel", font);
}

// Liangliang: It seems the renderText() func disables multi-sample and depth test
// Is this a bug in Qt ?
glEnable(GL_MULTISAMPLE);
glEnable(GL_DEPTH_TEST);
}


Expand Down Expand Up @@ -371,15 +375,6 @@ void PaintCanvas::drawCornerAxis()
// Draw text id
glColor3f(0, 0, 0);

// Liangliang: It seems the renderText() func disables multi-sample.
// Is this a bug in Qt ?
GLboolean anti_alias = glIsEnabled(GL_MULTISAMPLE);
const_cast<PaintCanvas*>(this)->renderText(axis_size, 0, 0, "X");
const_cast<PaintCanvas*>(this)->renderText(0, axis_size, 0, "Y");
const_cast<PaintCanvas*>(this)->renderText(0, 0, axis_size, "Z");
if (anti_alias)
glEnable(GL_MULTISAMPLE);

glMatrixMode(GL_PROJECTION);
glPopMatrix();

Expand Down

0 comments on commit 6fcda7f

Please sign in to comment.