Skip to content

Commit

Permalink
Added imgui docking branch
Browse files Browse the repository at this point in the history
Created a new docking only patch

Forgot to update the used patch file

fixed version
  • Loading branch information
tmayoff authored and jpakkane committed Dec 9, 2024
1 parent 06a12cd commit e7a20ea
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ci_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,14 @@
"libvulkan-dev"
]
},
"imgui-docking": {
"debian_packages": [
"liballegro5-dev",
"libglfw3-dev",
"libsdl2-dev",
"libvulkan-dev"
]
},
"imgui-sfml": {
"alpine_packages": [
"libudev-zero-dev",
Expand Down
8 changes: 8 additions & 0 deletions releases.json
Original file line number Diff line number Diff line change
Expand Up @@ -1358,6 +1358,14 @@
"1.76-1"
]
},
"imgui-docking": {
"dependency_names": [
"imgui_docking"
],
"versions": [
"1.91.0-1"
]
},
"imgui-sfml": {
"dependency_names": [
"imgui-sfml"
Expand Down
9 changes: 9 additions & 0 deletions subprojects/imgui-docking.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[wrap-file]
directory = imgui-1.91.0-docking
source_url = https://github.com/ocornut/imgui/archive/refs/tags/v1.91.0-docking.tar.gz
source_filename = imgui-docking-1.91.0.tar.gz
source_hash = b08a569eedcf2bf25e763e034754fdbe37dfcb035072310781c92fa6e6504bf7
patch_directory = imgui-docking

[provide]
imgui_docking = imgui_dep
131 changes: 131 additions & 0 deletions subprojects/packagefiles/imgui-docking/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
project(
'imgui',
'cpp',
license: 'MIT',
version: '1.91.0',
meson_version: '>=0.50.0',
)

if host_machine.system() == 'darwin'
add_languages('objcpp')
endif

include_dirs = include_directories('.', 'backends')
sources = files(
'misc/cpp/imgui_stdlib.cpp',
'imgui.cpp',
'imgui_demo.cpp',
'imgui_draw.cpp',
'imgui_tables.cpp',
'imgui_widgets.cpp',
)

cpp = meson.get_compiler('cpp')
dependencies = []

# renderer backends
dependencies += cpp.find_library('d3dcompiler', required: host_machine.system() == 'windows')
dx9_dep = cpp.find_library('d3d9', required: get_option('dx9'))
if dx9_dep.found()
sources += 'backends/imgui_impl_dx9.cpp'
dependencies += dx9_dep
endif
dx10_dep = cpp.find_library('d3d10', required: get_option('dx10'))
if dx10_dep.found()
sources += 'backends/imgui_impl_dx10.cpp'
dependencies += dx10_dep
endif
dx11_dep = cpp.find_library('d3d11', required: get_option('dx11'))
if dx11_dep.found()
sources += 'backends/imgui_impl_dx11.cpp'
dependencies += dx11_dep
endif
dx12_dep = cpp.find_library('d3d12', required: get_option('dx12'))
# MinGW does not work. See https://github.com/ocornut/imgui/pull/4604
if dx12_dep.found() and cpp.get_argument_syntax() == 'msvc'
sources += 'backends/imgui_impl_dx12.cpp'
dependencies += dx12_dep
endif
dxgi_dep = cpp.find_library('dxgi', required: get_option('dx12'))
if dxgi_dep.found() and cpp.get_argument_syntax() == 'msvc'
dependencies += dxgi_dep
endif

metal_dep = dependency('appleframeworks', modules: ['Foundation', 'AppKit', 'GameController', 'Metal', 'QuartzCore'], required: get_option('metal'))
if metal_dep.found()
sources += 'backends/imgui_impl_metal.mm'
dependencies += metal_dep
endif
libgl_dep = dependency('gl', required: get_option('opengl'))
if libgl_dep.found()
sources += 'backends/imgui_impl_opengl3.cpp'
dependencies += libgl_dep
dependencies += cpp.find_library('dl', required: false)
endif
sdl2_renderer_dep = dependency('sdl2', version: '>=2.0.17', required: get_option('sdl_renderer'))
if sdl2_renderer_dep.found()
sources += 'backends/imgui_impl_sdlrenderer2.cpp'
dependencies += sdl2_renderer_dep
endif
vulkan_dep = dependency('vulkan', required: get_option('vulkan'))
if vulkan_dep.found()
sources += 'backends/imgui_impl_vulkan.cpp'
dependencies += vulkan_dep
endif
if cpp.has_header('webgpu/webgpu.h', required: get_option('webgpu'))
sources += 'backends/imgui_impl_wgpu.cpp'
endif

# platform backends
glfw_dep = dependency('glfw3', required: get_option('glfw'))
if glfw_dep.found()
sources += 'backends/imgui_impl_glfw.cpp'
dependencies += glfw_dep
endif
sdl2_dep = dependency('sdl2', required: get_option('sdl2'))
if sdl2_dep.found()
sources += 'backends/imgui_impl_sdl2.cpp'
dependencies += sdl2_dep
endif
osx_dep = dependency('appleframeworks', modules: ['Carbon', 'Cocoa', 'GameController'], required: get_option('osx'))
if osx_dep.found()
sources += 'backends/imgui_impl_osx.mm'
endif
win_dep = cpp.find_library('dwmapi', required: get_option('win'))
if win_dep.found()
sources += 'backends/imgui_impl_win32.cpp'
dependencies += win_dep
endif

# frameworks
allegro5_dep = dependency('allegro-5', required: get_option('allegro5'))
allegro5_primitives_dep = dependency('allegro_primitives-5', required: get_option('allegro5'))
if allegro5_dep.found() and allegro5_primitives_dep.found()
sources += 'backends/imgui_impl_allegro5.cpp'
dependencies += [allegro5_dep, allegro5_primitives_dep]
endif

api = '-DIMGUI_API=__attribute__((visibility("default")))'
if host_machine.system() == 'windows'
api = '-DIMGUI_API=@0@'.format(get_option('default_library') != 'static' ? '__declspec(dllexport)' : '')
endif

imgui = library(
'imgui',
sources,
cpp_args: api,
gnu_symbol_visibility: 'hidden',
dependencies: dependencies,
include_directories: include_dirs,
install: true,
)

if host_machine.system() == 'windows'
api = '-DIMGUI_API=@0@'.format(get_option('default_library') != 'static' ? '__declspec(dllimport)' : '')
endif

imgui_dep = declare_dependency(
compile_args: api,
include_directories: include_dirs,
link_with: imgui,
)
19 changes: 19 additions & 0 deletions subprojects/packagefiles/imgui-docking/meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# renderer backends
option('dx9', type : 'feature', value : 'auto')
option('dx10', type : 'feature', value : 'auto')
option('dx11', type : 'feature', value : 'auto')
option('dx12', type : 'feature', value : 'auto')
option('metal', type : 'feature', value : 'auto')
option('opengl', type : 'feature', value : 'auto')
option('sdl_renderer', type : 'feature', value : 'auto')
option('vulkan', type : 'feature', value : 'auto')
option('webgpu', type : 'feature', value : 'auto')

# platform backends
option('glfw', type : 'feature', value : 'auto')
option('sdl2', type : 'feature', value : 'auto')
option('osx', type : 'feature', value : 'auto')
option('win', type : 'feature', value : 'auto')

# frameworks (renderer + platform)
option('allegro5', type : 'feature', value : 'auto')

0 comments on commit e7a20ea

Please sign in to comment.