nvpro-samples / optix_advanced_samples

417 stars 87 forks source link

for macosx install: updated glfw to dev branch 3.3; added FindSUtilGLUT #1

Closed sydneyzh closed 7 years ago

sydneyzh commented 7 years ago

Hello,

I made the following changes to finish the build on my machine (OSX10.11, which I'm afraid is the only version that I can test on for now).

updated glfw to dev branch 3.3 added FindSUtilGLUT to CMakeLists included glut.h in sutil.cpp for APPLE

dylanlacewell commented 7 years ago

Thanks, and sorry for the delay responding to this. I've been slammed getting ready for GTC. I'll take a look.

dylanlacewell commented 7 years ago

Hmm. Why add the GLUT dependency? The advanced samples use GLFW, not GLUT (despite some old comments in sutil.cpp that mention GLUT). Nothing in sutil.cpp depends on GLUT as far as I know. So what was it in glut.h that was needed on OSX, and can't be accomplished with glfw3.h?

sydneyzh commented 7 years ago

You are right, Dylan. I have replaced the only reference to GLUT -- "gluOrtho2D()" in "src/sutil/sutil.cpp" with "glOrtho()". Then the GLUT dependency can be dropped. @dylanlacewell

dylanlacewell commented 7 years ago

The gluOrtho2D() function should be in GL/glu.h, and we link in libGLU.so at least on Linux. It's not a GLUT function. If you include GL/glu.h rather than glut.h, are you able to go back to gluOrth2D?

sydneyzh commented 7 years ago

I looked again and did not see the error previously shown about gluOrho2D with osx10.11 which I tried to eliminate by including GLUT. Do not know if it has anything to do with me upgrading to Serria. I guess it is quite trivial to modify dependencies according to a Mac version. It is helpful to have this discussion though.

dylanlacewell commented 7 years ago

Yeah, thanks for digging into this regardless. So it works out of the box now, or you still needed to include glu.h in sutil.cpp? Any other changes needed?

sydneyzh commented 7 years ago

I needed to include <OpenGL/glu.h> in sutil.cpp to build, yes.