Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable glad on apple #2009

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/igl/opengl/gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
// #include <GL/gl.h>
//

#ifdef __APPLE__
#include <OpenGL/gl3.h>
#else
#include <glad/glad.h>
#endif

#endif
2 changes: 2 additions & 0 deletions include/igl/opengl/glfw/Viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,13 @@ namespace glfw
}
glfwMakeContextCurrent(window);
// Load OpenGL and its extensions
#ifndef __APPLE__
if (!gladLoadGLLoader((GLADloadproc) glfwGetProcAddress))
{
printf("Failed to load OpenGL and its extensions\n");
return(-1);
}
#endif
#if defined(DEBUG) || defined(_DEBUG)
printf("OpenGL Version %d.%d loaded\n", GLVersion.major, GLVersion.minor);
int major, minor, rev;
Expand Down
2 changes: 2 additions & 0 deletions include/igl/opengl/glfw/background_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ IGL_INLINE bool igl::opengl::glfw::background_window(GLFWwindow* & window)
window = glfwCreateWindow(1, 1,"", NULL, NULL);
if(!window) return false;
glfwMakeContextCurrent(window);
#ifndef __APPLE__
if (!gladLoadGLLoader((GLADloadproc) glfwGetProcAddress))
{
printf("Failed to load OpenGL and its extensions");
}
#endif
glGetError(); // pull and safely ignore unhandled errors like GL_INVALID_ENUM
return true;
}
Expand Down