From 5693918ee0f3ae1bbb4e77e2d70535cfc48515b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Beaune?= Date: Mon, 30 Apr 2018 23:00:26 +0200 Subject: [PATCH] Fix macOS build --- .../mainwindow/rendering/lightpathswidget.cpp | 15 +++++++++++++++ .../mainwindow/rendering/lightpathswidget.h | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/appleseed.studio/mainwindow/rendering/lightpathswidget.cpp b/src/appleseed.studio/mainwindow/rendering/lightpathswidget.cpp index df2dcac4f8..f5c6762f6b 100644 --- a/src/appleseed.studio/mainwindow/rendering/lightpathswidget.cpp +++ b/src/appleseed.studio/mainwindow/rendering/lightpathswidget.cpp @@ -55,6 +55,11 @@ #include #include +// Platform headers. +#ifdef __APPLE__ +#include +#endif + using namespace foundation; using namespace renderer; using namespace std; @@ -265,11 +270,21 @@ void LightPathsWidget::paintGL() glMatrixMode(GL_PROJECTION); glLoadIdentity(); +#ifdef __APPLE__ + glMultMatrixf( + GLKMatrix4MakePerspective( + rc.m_hfov / rc.m_aspect_ratio, + rc.m_aspect_ratio, + 0.01, + 1000.0 + ).m); +#else gluPerspective( rad_to_deg(rc.m_hfov) / rc.m_aspect_ratio, rc.m_aspect_ratio, 0.01, 1000.0); +#endif glMatrixMode(GL_MODELVIEW); glLoadIdentity(); diff --git a/src/appleseed.studio/mainwindow/rendering/lightpathswidget.h b/src/appleseed.studio/mainwindow/rendering/lightpathswidget.h index 7a7d753737..27d9aa0679 100644 --- a/src/appleseed.studio/mainwindow/rendering/lightpathswidget.h +++ b/src/appleseed.studio/mainwindow/rendering/lightpathswidget.h @@ -96,7 +96,7 @@ class LightPathsWidget void initializeGL() override; void resizeGL(int w, int h) override; void paintGL() override; - void keyPressEvent(QKeyEvent* event); + void keyPressEvent(QKeyEvent* event) override; void render_geometry() const; void render_light_paths() const;