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;