Merge pull request #648 from wwmayer/fix_warnings

Qt5OpenGL: replace gluOrtho2D for macOS
This commit is contained in:
wwmayer
2017-03-24 14:07:32 +01:00
committed by GitHub
3 changed files with 15 additions and 10 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>
@@ -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);
}