Skip to content

Commit

Permalink
imgui learned a wgpu config (#2562)
Browse files Browse the repository at this point in the history
  • Loading branch information
yig authored Sep 4, 2023
1 parent a12e2d8 commit d951fbd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/i/imgui/port/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ option("sdl2", {showmenu = true, default = false})
option("sdl2_renderer", {showmenu = true, default = false})
option("vulkan", {showmenu = true, default = false})
option("win32", {showmenu = true, default = false})
option("wgpu", {showmenu = true, default = false})
option("freetype", {showmenu = true, default = false})
option("user_config", {showmenu = true, default = nil, type = "string"})
option("wchar32", {showmenu = true, default = false})
Expand All @@ -35,6 +36,10 @@ if has_config("vulkan") then
add_requires("vulkansdk")
end

if has_config("wgpu") then
add_requires("wgpu-native")
end

if has_config("freetype") then
add_requires("freetype")
end
Expand Down Expand Up @@ -119,6 +124,12 @@ target("imgui")
add_files("backends/imgui_impl_win32.cpp")
add_headerfiles("(backends/imgui_impl_win32.h)")
end

if has_config("wgpu") then
add_files("backends/imgui_impl_wgpu.cpp")
add_headerfiles("(backends/imgui_impl_wgpu.h)")
add_packages("wgpu-native")
end

if has_config("freetype") then
add_files("misc/freetype/imgui_freetype.cpp")
Expand Down
5 changes: 5 additions & 0 deletions packages/i/imgui/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ package("imgui")
add_configs("sdl2_renderer", {description = "Enable the sdl2 renderer backend", default = false, type = "boolean"})
add_configs("vulkan", {description = "Enable the vulkan backend", default = false, type = "boolean"})
add_configs("win32", {description = "Enable the win32 backend", default = false, type = "boolean"})
add_configs("wgpu", {description = "Enable the wgpu backend", default = false, type = "boolean"})
add_configs("freetype", {description = "Use FreeType to build and rasterize the font atlas", default = false, type = "boolean"})
add_configs("user_config", {description = "Use user config (disables test!)", default = nil, type = "string"})
add_configs("wchar32", {description = "Use 32-bit for ImWchar (default is 16-bit)", default = false, type = "boolean"})
Expand Down Expand Up @@ -101,6 +102,9 @@ package("imgui")
if package:config("vulkan") then
package:add("deps", "vulkansdk")
end
if package:config("wgpu") then
package:add("deps", "wgpu-native")
end
if package:config("freetype") then
package:add("deps", "freetype")
end
Expand All @@ -123,6 +127,7 @@ package("imgui")
sdl2_renderer = package:config("sdl2_renderer"),
vulkan = package:config("vulkan"),
win32 = package:config("win32"),
wgpu = package:config("wgpu"),
freetype = package:config("freetype"),
user_config = package:config("user_config"),
wchar32 = package:config("wchar32")
Expand Down

0 comments on commit d951fbd

Please sign in to comment.