Skip to content

Commit

Permalink
replace deprecated gluPickMatrix
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Mar 6, 2017
1 parent b1347ec commit 7711d71
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/Mod/Mesh/Gui/SoFCIndexedFaceSet.cpp
Expand Up @@ -267,7 +267,12 @@ void SoFCIndexedFaceSet::startSelection(SoAction * action)
//glGetDoublev(GL_PROJECTION_MATRIX ,mp);
glPushMatrix();
glLoadIdentity();
gluPickMatrix(x, y, w, h, viewport);
// See https://www.opengl.org/discussion_boards/showthread.php/184308-gluPickMatrix-Implementation?p=1259884&viewfull=1#post1259884
//gluPickMatrix(x, y, w, h, viewport);
if (w > 0 && h > 0) {
glTranslatef((viewport[2] - 2 * (x - viewport[0])) / w, (viewport[3] - 2 * (y - viewport[1])) / h, 0);
glScalef(viewport[2] / w, viewport[3] / h, 1.0);
}
glMultMatrixf(/*mp*/(float*)proj);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
Expand Down
7 changes: 6 additions & 1 deletion src/Mod/Mesh/Gui/SoFCMeshObject.cpp
Expand Up @@ -899,7 +899,12 @@ void SoFCMeshObjectShape::startSelection(SoAction * action, const Mesh::MeshObje
//glGetDoublev(GL_PROJECTION_MATRIX ,mp);
glPushMatrix();
glLoadIdentity();
gluPickMatrix(x, y, w, h, viewport);
// See https://www.opengl.org/discussion_boards/showthread.php/184308-gluPickMatrix-Implementation?p=1259884&viewfull=1#post1259884
//gluPickMatrix(x, y, w, h, viewport);
if (w > 0 && h > 0) {
glTranslatef((viewport[2] - 2 * (x - viewport[0])) / w, (viewport[3] - 2 * (y - viewport[1])) / h, 0);
glScalef(viewport[2] / w, viewport[3] / h, 1.0);
}
glMultMatrixf(/*mp*/this->projection);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
Expand Down

0 comments on commit 7711d71

Please sign in to comment.