update imgui vulkan backend (#1457)

pull/1459/head
Frank Zhuang 2 years ago committed by GitHub
parent af0a692d98
commit 039a8540f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      packages/i/imgui/port/xmake.lua
  2. 4
      packages/i/imgui/xmake.lua

@ -4,6 +4,7 @@ set_languages("cxx11")
option("wchar32", {showmenu = true, default = false})
option("freetype", {showmenu = true, default = false})
option("glfw_opengl3", {showmenu = true, default = false})
option("glfw_vulkan", {showmenu = true, default = false})
option("user_config", {showmenu = true, default = nil, type = "string"})
option("use_glad", {showmenu = true, default = false})
@ -16,6 +17,10 @@ if has_config("glfw_opengl3") then
if has_config("use_glad") then
add_requires("glad")
end
elseif has_config("glfw_vulkan") then
add_requires("glfw")
add_requires("vulkansdk")
add_requires("vulkan-headers")
end
target("imgui")
@ -47,6 +52,11 @@ target("imgui")
else
add_headerfiles("backends/imgui_impl_opengl3_loader.h")
end
elseif has_config("glfw_vulkan") then
add_files("backends/imgui_impl_vulkan.cpp", "backends/imgui_impl_glfw.cpp")
add_headerfiles("backends/imgui_impl_vulkan.h", "backends/imgui_impl_glfw.h")
add_packages("glfw")
add_packages("vulkan-headers")
end
if has_config("user_config") then
@ -63,4 +73,4 @@ target("imgui")
if has_config("freetype") then
io.gsub(config_file, "//#define IMGUI_ENABLE_FREETYPE", "#define IMGUI_ENABLE_FREETYPE")
end
end)
end)

@ -25,6 +25,7 @@ package("imgui")
add_configs("user_config", {description = "Use user config (disables test!)", default = nil, type = "string"})
add_configs("glfw_opengl3", {description = "Use glfw+opengl3 as backend", default = false, type = "boolean"})
add_configs("glfw_vulkan", {description = "Use glfw+vulkan as backend", default = false, type = "boolean"})
add_configs("wchar32", {description = "Use 32-bit for ImWchar (default is 16-bit)", default = false, type = "boolean"})
add_configs("freetype", {description = "Use FreeType to build and rasterize the font atlas", default = false, type = "boolean"})
@ -44,6 +45,8 @@ package("imgui")
package:add("defines", "IMGUI_IMPL_OPENGL_LOADER_GLAD")
end
package:add("deps", "glfw")
elseif package:config("glfw_vulkan") then
package:add("deps", "glfw")
end
if package:version_str():find("-docking", 1, true) then
package:set("urls", {"https://github.com/ocornut/imgui.git"})
@ -55,6 +58,7 @@ package("imgui")
wchar32 = package:config("wchar32"),
freetype = package:config("freetype"),
glfw_opengl3 = package:config("glfw_opengl3"),
glfw_vulkan = package:config("glfw_vulkan"),
user_config = package:config("user_config"),
use_glad = package:version():lt("1.84") -- this flag will be used if glfw_opengl3 is enabled
}

Loading…
Cancel
Save