allow to configure glfw on Mac OSX, disabled by default
This commit is contained in:
@@ -249,6 +249,33 @@ end
|
|||||||
_OPTIONS["python_lib_dir"] = default_python_lib_dir
|
_OPTIONS["python_lib_dir"] = default_python_lib_dir
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if os.is("Linux") then
|
||||||
|
default_glfw_include_dir = "usr/local/include/GLFW"
|
||||||
|
default_glfw_lib_dir = "/usr/local/lib/"
|
||||||
|
default_glfw_lib_name = "glfw3"
|
||||||
|
end
|
||||||
|
|
||||||
|
if os.is("macosx") then
|
||||||
|
default_glfw_include_dir = "/usr/local/Cellar/glfw/3.2.1/include"
|
||||||
|
default_glfw_lib_dir = "/usr/local/Cellar/glfw/3.2.1/lib"
|
||||||
|
default_glfw_lib_name = "glfw"
|
||||||
|
end
|
||||||
|
|
||||||
|
if os.is("Windows") then
|
||||||
|
default_glfw_include_dir = ""
|
||||||
|
default_glfw_lib_dir = ""
|
||||||
|
default_glfw_lib_name = "glfw3"
|
||||||
|
end
|
||||||
|
|
||||||
|
if not _OPTIONS["glfw_lib_dir"] then
|
||||||
|
_OPTIONS["glfw_lib_dir"] = default_glfw_lib_dir
|
||||||
|
end
|
||||||
|
if not _OPTIONS["glfw_include_dir"] then
|
||||||
|
_OPTIONS["glfw_include_dir"] = default_glfw_include_dir
|
||||||
|
end
|
||||||
|
if not _OPTIONS["glfw_lib_name"] then
|
||||||
|
_OPTIONS["glfw_lib_name"] = default_glfw_lib_name
|
||||||
|
end
|
||||||
newoption
|
newoption
|
||||||
{
|
{
|
||||||
trigger = "glfw_include_dir",
|
trigger = "glfw_include_dir",
|
||||||
@@ -256,6 +283,13 @@ end
|
|||||||
description = "GLFW 3.x include directory"
|
description = "GLFW 3.x include directory"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
newoption
|
||||||
|
{
|
||||||
|
trigger = "glfw_lib_name",
|
||||||
|
value = default_glfw_lib_name,
|
||||||
|
description = "GLFW 3.x library name (glfw, glfw3)"
|
||||||
|
}
|
||||||
|
|
||||||
newoption
|
newoption
|
||||||
{
|
{
|
||||||
trigger = "glfw_lib_dir",
|
trigger = "glfw_lib_dir",
|
||||||
@@ -287,7 +321,7 @@ end
|
|||||||
libdirs {
|
libdirs {
|
||||||
_OPTIONS["glfw_lib_dir"]
|
_OPTIONS["glfw_lib_dir"]
|
||||||
}
|
}
|
||||||
links {"glfw3"}
|
links { _OPTIONS["glfw_lib_name"]}
|
||||||
files { projectRootDir .. "examples/ThirdPartyLibs/glad/glad.c" }
|
files { projectRootDir .. "examples/ThirdPartyLibs/glad/glad.c" }
|
||||||
end
|
end
|
||||||
function findOpenGL3()
|
function findOpenGL3()
|
||||||
|
|||||||
@@ -276,6 +276,8 @@ void GLFWOpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci)
|
|||||||
{
|
{
|
||||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
|
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
|
||||||
|
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
||||||
|
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user