@@ -63,13 +63,22 @@
|
|||||||
|
|
||||||
if os.is("Linux") then
|
if os.is("Linux") then
|
||||||
configuration{"Linux"}
|
configuration{"Linux"}
|
||||||
print("Using glad and dynamic loading of glx functions")
|
if _OPTIONS["enable_system_glx"] then --# and (os.isdir("/usr/include") and os.isfile("/usr/include/GL/glx.h")) then
|
||||||
defines { "GLEW_STATIC","GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1"}
|
links{"X11","pthread"}
|
||||||
|
print("Using system GL/glx.h")
|
||||||
|
else
|
||||||
|
print("Using glad_glx")
|
||||||
|
defines { "GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1"}
|
||||||
|
files {
|
||||||
|
projectRootDir .. "examples/ThirdPartyLibs/glad/glad_glx.c"}
|
||||||
|
end
|
||||||
|
|
||||||
|
print("Using glad and dynamic loading of GL functions")
|
||||||
|
defines { "GLEW_STATIC"}
|
||||||
includedirs {
|
includedirs {
|
||||||
projectRootDir .. "examples/ThirdPartyLibs/glad"
|
projectRootDir .. "examples/ThirdPartyLibs/glad"
|
||||||
}
|
}
|
||||||
files { projectRootDir .. "examples/ThirdPartyLibs/glad/glad.c",
|
files { projectRootDir .. "examples/ThirdPartyLibs/glad/glad.c"}
|
||||||
projectRootDir .. "examples/ThirdPartyLibs/glad/glad_glx.c"}
|
|
||||||
links {"dl"}
|
links {"dl"}
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -28,6 +28,12 @@
|
|||||||
description = "Enable iOS target (requires xcode4)"
|
description = "Enable iOS target (requires xcode4)"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newoption
|
||||||
|
{
|
||||||
|
trigger = "enable_system_glx",
|
||||||
|
description = "Try to link against system glx instead of using glad_glx (default)"
|
||||||
|
}
|
||||||
|
|
||||||
newoption
|
newoption
|
||||||
{
|
{
|
||||||
trigger = "enable_system_opengl",
|
trigger = "enable_system_opengl",
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
|
#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
|
||||||
#include "glad/glad_glx.h"
|
#include "glad/glad_glx.h"
|
||||||
#else
|
#else
|
||||||
#include "GL/glx.h"
|
#include <GL/glx.h>
|
||||||
#endif // GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
|
#endif // GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user