Skip to content

Commit

Permalink
Fix macOS build
Browse files Browse the repository at this point in the history
  • Loading branch information
dictoon authored and est77 committed Apr 30, 2018
1 parent 127e530 commit 5693918
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/appleseed.studio/mainwindow/rendering/lightpathswidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
#include <algorithm>
#include <string>

// Platform headers.
#ifdef __APPLE__
#include <GLKit/GLKMatrix4.h>
#endif

using namespace foundation;
using namespace renderer;
using namespace std;
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5693918

Please sign in to comment.