use glad instead of glew in mac build and pybullet setup.py

This commit is contained in:
Erwin Coumans
2018-02-20 20:09:12 -08:00
parent b0984de046
commit dacafda88a
3 changed files with 20 additions and 5 deletions

View File

@@ -54,6 +54,13 @@
}
files { projectRootDir .. "examples/ThirdPartyLibs/glad/glad.c"}
end
if os.is("MacOSX") then
includedirs {
projectRootDir .. "examples/ThirdPartyLibs/glad"
}
files { projectRootDir .. "examples/ThirdPartyLibs/glad/glad.c"}
end
if os.is("Linux") then
configuration{"Linux"}
print("Using glad and dynamic loading of glx functions")

View File

@@ -403,6 +403,8 @@ int Mac_createWindow(struct MacOpenGLWindowInternalData* m_internalData,struct M
[m_internalData->m_myview initWithFrame: frame];
// OpenGL init!
[m_internalData->m_myview MakeContext : ci->m_openglVersion];
@@ -481,6 +483,11 @@ int Mac_createWindow(struct MacOpenGLWindowInternalData* m_internalData,struct M
[m_internalData->m_myApp finishLaunching];
[pool release];
if(!gladLoadGL()) {
printf("gladLoadGL failed!\n");
exit(-1);
}
return 0;
}

View File

@@ -388,7 +388,7 @@ if _platform == "linux" or _platform == "linux2":
CXX_FLAGS += '-fno-inline-functions-called-once'
sources = sources + ["examples/ThirdPartyLibs/enet/unix.c"]\
+["examples/OpenGLWindow/X11OpenGLWindow.cpp"]\
+["examples/ThirdPartyLibs/Glew/glew.c"]
+["examples/ThirdPartyLibs/glad/glad.c"]
include_dirs += ["examples/ThirdPartyLibs/optionalX11"]
elif _platform == "win32":
print("win32!")
@@ -398,7 +398,7 @@ elif _platform == "win32":
sources = sources + ["examples/ThirdPartyLibs/enet/win32.c"]\
+["examples/OpenGLWindow/Win32Window.cpp"]\
+["examples/OpenGLWindow/Win32OpenGLWindow.cpp"]\
+["examples/ThirdPartyLibs/Glew/glew.c"]
+["examples/ThirdPartyLibs/glad/glad.c"]
elif _platform == "darwin":
print("darwin!")
os.environ['LDFLAGS'] = '-framework Cocoa -framework OpenGL'
@@ -408,6 +408,7 @@ elif _platform == "darwin":
# CXX_FLAGS += '-framework Cocoa '
sources = sources + ["examples/ThirdPartyLibs/enet/unix.c"]\
+["examples/OpenGLWindow/MacOpenGLWindow.cpp"]\
+["examples/ThirdPartyLibs/glad/glad.c"]\
+["examples/OpenGLWindow/MacOpenGLWindowObjC.m"]
else:
print("bsd!")
@@ -419,7 +420,7 @@ else:
CXX_FLAGS += '-fno-inline-functions-called-once'
sources = ["examples/ThirdPartyLibs/enet/unix.c"]\
+["examples/OpenGLWindow/X11OpenGLWindow.cpp"]\
+["examples/ThirdPartyLibs/Glew/glew.c"]\
+["examples/ThirdPartyLibs/glad/glad.c"]\
+ sources
setup_py_dir = os.path.dirname(os.path.realpath(__file__))
@@ -457,7 +458,7 @@ setup(
sources = sources,
libraries = libraries,
extra_compile_args=CXX_FLAGS.split(),
include_dirs = include_dirs + ["src","examples/ThirdPartyLibs","examples/ThirdPartyLibs/Glew", "examples/ThirdPartyLibs/enet/include","examples/ThirdPartyLibs/clsocket/src"]
include_dirs = include_dirs + ["src","examples/ThirdPartyLibs","examples/ThirdPartyLibs/glad", "examples/ThirdPartyLibs/enet/include","examples/ThirdPartyLibs/clsocket/src"]
) ],
classifiers=['Development Status :: 5 - Production/Stable',
'License :: OSI Approved :: zlib/libpng License',