Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #648 from wwmayer/fix_warnings
Qt5OpenGL: replace gluOrtho2D for macOS
  • Loading branch information
wwmayer committed Mar 24, 2017
2 parents 4a639b6 + e96390e commit e006178
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
9 changes: 9 additions & 0 deletions src/Gui/SoFCUnifiedSelection.cpp
Expand Up @@ -64,6 +64,15 @@
#include <Inventor/events/SoLocation2Event.h>
#include <Inventor/SoPickedPoint.h>

#ifdef FC_OS_MACOSX
# include <OpenGL/gl.h>
#else
# ifdef FC_OS_WIN32
# include <windows.h>
# endif
# include <GL/gl.h>
#endif

#include <QtOpenGL.h>

#include <Base/Console.h>
Expand Down
10 changes: 0 additions & 10 deletions src/Gui/SoFCUnifiedSelection.h
Expand Up @@ -23,16 +23,6 @@
#ifndef GUI_SOFCUNIFIEDSELECTION_H
#define GUI_SOFCUNIFIEDSELECTION_H

# ifdef FC_OS_MACOSX
# include <OpenGL/gl.h>
# else
# ifdef FC_OS_WIN32
# define NOMINMAX
# include <windows.h>
# endif
# include <GL/gl.h>
# endif

#include <Inventor/nodes/SoSubNode.h>
#include <Inventor/nodes/SoSeparator.h>
#include <Inventor/fields/SoSFBool.h>
Expand Down
6 changes: 6 additions & 0 deletions src/Mod/Image/Gui/OpenGLImageBox.cpp
Expand Up @@ -34,6 +34,7 @@
#elif defined (FC_OS_MACOSX)
# include <OpenGL/gl.h>
# include <OpenGL/glu.h>
# include <GLKit/GLKMatrix4.h>
#elif defined (FC_OS_WIN32)
# include <Windows.h>
# include <GL/gl.h>
Expand Down Expand Up @@ -150,7 +151,12 @@ void GLImageBox::resizeGL( int w, int h )
glViewport( 0, 0, (GLint)w, (GLint)h );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
#if defined (FC_OS_MACOSX)
GLKMatrix4 orthoMat = GLKMatrix4MakeOrtho(0, width() - 1, height() - 1, 0, -1, 1);
glLoadMatrixf(orthoMat.m);
#else
gluOrtho2D(0, width() - 1, height() - 1, 0);
#endif
glMatrixMode(GL_MODELVIEW);
}

Expand Down

0 comments on commit e006178

Please sign in to comment.