use glad instead of glew in mac build and pybullet setup.py
This commit is contained in:
@@ -54,6 +54,13 @@
|
|||||||
}
|
}
|
||||||
files { projectRootDir .. "examples/ThirdPartyLibs/glad/glad.c"}
|
files { projectRootDir .. "examples/ThirdPartyLibs/glad/glad.c"}
|
||||||
end
|
end
|
||||||
|
if os.is("MacOSX") then
|
||||||
|
includedirs {
|
||||||
|
projectRootDir .. "examples/ThirdPartyLibs/glad"
|
||||||
|
}
|
||||||
|
files { projectRootDir .. "examples/ThirdPartyLibs/glad/glad.c"}
|
||||||
|
end
|
||||||
|
|
||||||
if os.is("Linux") then
|
if os.is("Linux") then
|
||||||
configuration{"Linux"}
|
configuration{"Linux"}
|
||||||
print("Using glad and dynamic loading of glx functions")
|
print("Using glad and dynamic loading of glx functions")
|
||||||
|
|||||||
@@ -403,6 +403,8 @@ int Mac_createWindow(struct MacOpenGLWindowInternalData* m_internalData,struct M
|
|||||||
|
|
||||||
[m_internalData->m_myview initWithFrame: frame];
|
[m_internalData->m_myview initWithFrame: frame];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// OpenGL init!
|
// OpenGL init!
|
||||||
[m_internalData->m_myview MakeContext : ci->m_openglVersion];
|
[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];
|
[m_internalData->m_myApp finishLaunching];
|
||||||
[pool release];
|
[pool release];
|
||||||
|
|
||||||
|
if(!gladLoadGL()) {
|
||||||
|
printf("gladLoadGL failed!\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
9
setup.py
9
setup.py
@@ -388,7 +388,7 @@ if _platform == "linux" or _platform == "linux2":
|
|||||||
CXX_FLAGS += '-fno-inline-functions-called-once'
|
CXX_FLAGS += '-fno-inline-functions-called-once'
|
||||||
sources = sources + ["examples/ThirdPartyLibs/enet/unix.c"]\
|
sources = sources + ["examples/ThirdPartyLibs/enet/unix.c"]\
|
||||||
+["examples/OpenGLWindow/X11OpenGLWindow.cpp"]\
|
+["examples/OpenGLWindow/X11OpenGLWindow.cpp"]\
|
||||||
+["examples/ThirdPartyLibs/Glew/glew.c"]
|
+["examples/ThirdPartyLibs/glad/glad.c"]
|
||||||
include_dirs += ["examples/ThirdPartyLibs/optionalX11"]
|
include_dirs += ["examples/ThirdPartyLibs/optionalX11"]
|
||||||
elif _platform == "win32":
|
elif _platform == "win32":
|
||||||
print("win32!")
|
print("win32!")
|
||||||
@@ -398,7 +398,7 @@ elif _platform == "win32":
|
|||||||
sources = sources + ["examples/ThirdPartyLibs/enet/win32.c"]\
|
sources = sources + ["examples/ThirdPartyLibs/enet/win32.c"]\
|
||||||
+["examples/OpenGLWindow/Win32Window.cpp"]\
|
+["examples/OpenGLWindow/Win32Window.cpp"]\
|
||||||
+["examples/OpenGLWindow/Win32OpenGLWindow.cpp"]\
|
+["examples/OpenGLWindow/Win32OpenGLWindow.cpp"]\
|
||||||
+["examples/ThirdPartyLibs/Glew/glew.c"]
|
+["examples/ThirdPartyLibs/glad/glad.c"]
|
||||||
elif _platform == "darwin":
|
elif _platform == "darwin":
|
||||||
print("darwin!")
|
print("darwin!")
|
||||||
os.environ['LDFLAGS'] = '-framework Cocoa -framework OpenGL'
|
os.environ['LDFLAGS'] = '-framework Cocoa -framework OpenGL'
|
||||||
@@ -408,6 +408,7 @@ elif _platform == "darwin":
|
|||||||
# CXX_FLAGS += '-framework Cocoa '
|
# CXX_FLAGS += '-framework Cocoa '
|
||||||
sources = sources + ["examples/ThirdPartyLibs/enet/unix.c"]\
|
sources = sources + ["examples/ThirdPartyLibs/enet/unix.c"]\
|
||||||
+["examples/OpenGLWindow/MacOpenGLWindow.cpp"]\
|
+["examples/OpenGLWindow/MacOpenGLWindow.cpp"]\
|
||||||
|
+["examples/ThirdPartyLibs/glad/glad.c"]\
|
||||||
+["examples/OpenGLWindow/MacOpenGLWindowObjC.m"]
|
+["examples/OpenGLWindow/MacOpenGLWindowObjC.m"]
|
||||||
else:
|
else:
|
||||||
print("bsd!")
|
print("bsd!")
|
||||||
@@ -419,7 +420,7 @@ else:
|
|||||||
CXX_FLAGS += '-fno-inline-functions-called-once'
|
CXX_FLAGS += '-fno-inline-functions-called-once'
|
||||||
sources = ["examples/ThirdPartyLibs/enet/unix.c"]\
|
sources = ["examples/ThirdPartyLibs/enet/unix.c"]\
|
||||||
+["examples/OpenGLWindow/X11OpenGLWindow.cpp"]\
|
+["examples/OpenGLWindow/X11OpenGLWindow.cpp"]\
|
||||||
+["examples/ThirdPartyLibs/Glew/glew.c"]\
|
+["examples/ThirdPartyLibs/glad/glad.c"]\
|
||||||
+ sources
|
+ sources
|
||||||
|
|
||||||
setup_py_dir = os.path.dirname(os.path.realpath(__file__))
|
setup_py_dir = os.path.dirname(os.path.realpath(__file__))
|
||||||
@@ -457,7 +458,7 @@ setup(
|
|||||||
sources = sources,
|
sources = sources,
|
||||||
libraries = libraries,
|
libraries = libraries,
|
||||||
extra_compile_args=CXX_FLAGS.split(),
|
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',
|
classifiers=['Development Status :: 5 - Production/Stable',
|
||||||
'License :: OSI Approved :: zlib/libpng License',
|
'License :: OSI Approved :: zlib/libpng License',
|
||||||
|
|||||||
Reference in New Issue
Block a user