Skip to content

Commit 70cea30

Browse files
committed
Merge pull request #393 from xlz/macosx-opengl
Fix GLFW setup on Mac OSX, closes #386
2 parents e6aba11 + 71e444d commit 70cea30

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

examples/protonect/src/opengl_depth_packet_processor.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -869,11 +869,14 @@ OpenGLDepthPacketProcessor::OpenGLDepthPacketProcessor(void *parent_opengl_conte
869869
// setup context
870870
glfwDefaultWindowHints();
871871
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
872+
#ifdef __APPLE__
873+
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
874+
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
875+
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
876+
#else
872877
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
873-
#ifdef __APPLE__
874-
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
875-
#endif
876878
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_ANY_PROFILE);
879+
#endif
877880
glfwWindowHint(GLFW_VISIBLE, debug ? GL_TRUE : GL_FALSE);
878881

879882
GLFWwindow* window = glfwCreateWindow(1024, 848, "OpenGLDepthPacketProcessor", 0, parent_window);

0 commit comments

Comments
 (0)