[imgui][many ports] Update to 1.92.6, support WebGPU feature (#48619)

This commit is contained in:
PARK DongHa 2026-03-13 16:26:53 +09:00 committed by GitHub
parent b70a4e216a
commit a44707152f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
38 changed files with 652 additions and 80 deletions

View File

@ -0,0 +1,25 @@
diff --git a/dart/gui/osg/ImGuiHandler.cpp b/dart/gui/osg/ImGuiHandler.cpp
index 39b1005..05e252c 100644
--- a/dart/gui/osg/ImGuiHandler.cpp
+++ b/dart/gui/osg/ImGuiHandler.cpp
@@ -128,16 +128,16 @@ ConvertedKey convertFromOSGKey(int key)
return ImGuiKey_Escape;
case KeySymbol::KEY_Control_L:
case KeySymbol::KEY_Control_R:
- return ImGuiKey_ModCtrl;
+ return ImGuiMod_Ctrl;
case KeySymbol::KEY_Shift_L:
case KeySymbol::KEY_Shift_R:
- return ImGuiKey_ModShift;
+ return ImGuiMod_Shift;
case KeySymbol::KEY_Alt_L:
case KeySymbol::KEY_Alt_R:
- return ImGuiKey_ModAlt;
+ return ImGuiMod_Alt;
case KeySymbol::KEY_Super_L:
case KeySymbol::KEY_Super_R:
- return ImGuiKey_ModSuper;
+ return ImGuiMod_Super;
case KeySymbol::KEY_A:
return ImGuiKey_A;
case KeySymbol::KEY_C:

View File

@ -16,6 +16,7 @@ vcpkg_from_github(
0004-pkgconfig.patch
0005-add-cassert.patch
0006-support-eigen3-5.patch
0007-fix-imgui.patch
)
file(REMOVE_RECURSE "${SOURCE_PATH}/dart/external/imgui")

View File

@ -1,7 +1,7 @@
{
"name": "dartsim",
"version": "6.15.0",
"port-version": 6,
"port-version": 7,
"description": "Dynamic Animation and Robotics Toolkit",
"homepage": "https://dartsim.github.io/",
"license": "BSD-2-Clause",

View File

@ -28,3 +28,16 @@ index 2b93540..6cfa3f8 100644
include(${CMAKE_CURRENT_LIST_DIR}/hello_imgui_cmake/hello_imgui_add_app.cmake)
include(${CMAKE_CURRENT_LIST_DIR}/hello-imgui-targets.cmake)
diff --git a/hello_imgui_cmake/hello_imgui_build_lib.cmake b/hello_imgui_cmake/hello_imgui_build_lib.cmake
index 7b5e7ac..37f5910 100644
--- a/hello_imgui_cmake/hello_imgui_build_lib.cmake
+++ b/hello_imgui_cmake/hello_imgui_build_lib.cmake
@@ -1181,7 +1181,7 @@ endfunction()
# Install: API = him_install
###################################################################################################
function(him_install)
- if (HELLOIMGUI_INSTALL AND NOT IOS AND NOT ANDROID)
+ if (HELLOIMGUI_INSTALL)
install(TARGETS ${HELLOIMGUI_TARGET} DESTINATION lib/)
file(GLOB headers *.h)
install(FILES ${headers} DESTINATION include/hello_imgui/)

View File

@ -0,0 +1,13 @@
diff --git a/src/hello_imgui/internal/hello_imgui_assets.cpp b/src/hello_imgui/internal/hello_imgui_assets.cpp
index 028c8ef..d7ec663 100644
--- a/src/hello_imgui/internal/hello_imgui_assets.cpp
+++ b/src/hello_imgui/internal/hello_imgui_assets.cpp
@@ -249,7 +249,7 @@ std::string AssetFileFullPath(const std::string& assetFilename, bool assertIfNot
// Returns true if this asset file exists
bool AssetExists(const std::string& assetFilename)
{
-#ifdef __ANDROID__
+#if defined(__ANDROID__) && defined(HELLOIMGUI_USE_SDL2)
size_t dataSize;
void *data = SDL_LoadFile(assetFilename.c_str(), &dataSize);
bool exists = (data != nullptr);

View File

@ -0,0 +1,23 @@
diff --git a/src/hello_imgui/internal/image_vulkan.h b/src/hello_imgui/internal/image_vulkan.h
index ee165d0..aa0e445 100644
--- a/src/hello_imgui/internal/image_vulkan.h
+++ b/src/hello_imgui/internal/image_vulkan.h
@@ -18,12 +18,12 @@ namespace HelloImGui
// Specific to Vulkan
VkDescriptorSet DS;
static constexpr int Channels = 4; // We intentionally only support RGBA for now
- VkImageView ImageView = nullptr;
- VkImage Image = nullptr;
- VkDeviceMemory ImageMemory = nullptr;
- VkSampler Sampler = nullptr;
- VkBuffer UploadBuffer = nullptr;
- VkDeviceMemory UploadBufferMemory = nullptr;
+ VkImageView ImageView;
+ VkImage Image;
+ VkDeviceMemory ImageMemory;
+ VkSampler Sampler;
+ VkBuffer UploadBuffer;
+ VkDeviceMemory UploadBufferMemory;
};
}

View File

@ -4,13 +4,13 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO pthom/hello_imgui
REF "v${VERSION}"
SHA512 b44741e27278974f6a545a3143abd18027d98503cc912085e08528c467197fb208d2d4876e483f74e518f3dfc14d12c3579e379b9939dc364a1fff4ee98bb8f5
SHA512 a81faf70a564147cf9c4587de54e46965b744ce93afadf7c9ce8a4868a9a584eea0c8f8df0c7f701e0404b4984f95ecfa3f5aa36a94ef2a84eaadbcc1e80c9b7
HEAD_REF master
PATCHES
cmake-config.diff
imgui-test-engine.diff
# PR has been merged into https://github.com/pthom/hello_imgui/pull/142. This patch should not be needed in the next release.
support-imgui-1_91_9.patch
disable-sdl-android.patch
fix-vulkan-binding.patch
)
file(REMOVE_RECURSE
"${SOURCE_PATH}/external/imgui"

View File

@ -1,49 +0,0 @@
diff --git a/src/hello_imgui/impl/imgui_theme.cpp b/src/hello_imgui/impl/imgui_theme.cpp
index 8bc60cb..87f2de4 100644
--- a/src/hello_imgui/impl/imgui_theme.cpp
+++ b/src/hello_imgui/impl/imgui_theme.cpp
@@ -314,7 +314,7 @@ namespace ImGuiTheme
style.GrabRounding = 0.0f;
style.TabRounding = 0.0f;
style.TabBorderSize = 0.0f;
- style.TabMinWidthForCloseButton = 0.0f;
+ style.TabCloseButtonMinWidthUnselected = 0.0f;
style.ColorButtonPosition = ImGuiDir_Left;
style.ButtonTextAlign = ImVec2(0.5f, 0.5f);
style.SelectableTextAlign = ImVec2(0.0f, 0.0f);
@@ -408,7 +408,7 @@ namespace ImGuiTheme
style.GrabRounding = 0.0f;
style.TabRounding = 0.0f;
style.TabBorderSize = 1.0f;
- style.TabMinWidthForCloseButton = 0.0f;
+ style.TabCloseButtonMinWidthUnselected = 0.0f;
style.ColorButtonPosition = ImGuiDir_Right;
style.ButtonTextAlign = ImVec2(0.5f, 0.5f);
style.SelectableTextAlign = ImVec2(0.0f, 0.0f);
@@ -577,7 +577,7 @@ namespace ImGuiTheme
style.GrabRounding = 0.0f;
style.TabRounding = 4.0f;
style.TabBorderSize = 0.0f;
- style.TabMinWidthForCloseButton = 0.0f;
+ style.TabCloseButtonMinWidthUnselected = 0.0f;
style.ColorButtonPosition = ImGuiDir_Right;
style.ButtonTextAlign = ImVec2(0.5f, 0.5f);
style.SelectableTextAlign = ImVec2(0.0f, 0.0f);
@@ -615,7 +615,7 @@ namespace ImGuiTheme
style.GrabRounding = 2.0f;
style.TabRounding = 4.0f;
style.TabBorderSize = 1.0f;
- style.TabMinWidthForCloseButton = 0.0f;
+ style.TabCloseButtonMinWidthUnselected = 0.0f;
style.ColorButtonPosition = ImGuiDir_Right;
style.ButtonTextAlign = ImVec2(0.5f, 0.5f);
style.SelectableTextAlign = ImVec2(0.0f, 0.0f);
@@ -814,7 +814,7 @@ namespace ImGuiTheme
style.ScrollbarSize = 15.5f;
style.GrabMinSize = 10.89999961853027f;
style.TabBorderSize = 1.0f;
- style.TabMinWidthForCloseButton = 0.0f;
+ style.TabCloseButtonMinWidthUnselected = 0.0f;
style.ColorButtonPosition = ImGuiDir_Right;
style.ButtonTextAlign = ImVec2(0.5f, 0.5f);
style.SelectableTextAlign = ImVec2(0.0f, 0.5f);

View File

@ -1,7 +1,6 @@
{
"name": "hello-imgui",
"version": "1.6.0",
"port-version": 3,
"version": "1.92.5",
"description": [
"Hello ImGui: unleash your creativity in app development and prototyping",
"Note that at least on renderer backend and at least one platform backend must be chosen."

View File

@ -0,0 +1,79 @@
diff --git a/imgui_node_editor.cpp b/imgui_node_editor.cpp
index 7dee2e4..4b2ea5f 100644
--- a/imgui_node_editor.cpp
+++ b/imgui_node_editor.cpp
@@ -1659,7 +1659,8 @@ void ed::EditorContext::SetNodePosition(NodeId nodeId, const ImVec2& position)
if (node->m_Bounds.Min != position)
{
node->m_Bounds.Translate(position - node->m_Bounds.Min);
- node->m_Bounds.Floor();
+ node->m_Bounds.Min = ImFloor(node->m_Bounds.Min);
+ node->m_Bounds.Max = ImFloor(node->m_Bounds.Max);
MakeDirty(NodeEditor::SaveReasonFlags::Position, node);
}
}
@@ -1679,7 +1680,8 @@ void ed::EditorContext::SetGroupSize(NodeId nodeId, const ImVec2& size)
{
node->m_GroupBounds.Min = node->m_Bounds.Min;
node->m_GroupBounds.Max = node->m_Bounds.Min + size;
- node->m_GroupBounds.Floor();
+ node->m_GroupBounds.Min = ImFloor(node->m_GroupBounds.Min);
+ node->m_GroupBounds.Max = ImFloor(node->m_GroupBounds.Max);
MakeDirty(NodeEditor::SaveReasonFlags::Size, node);
}
}
@@ -1757,10 +1759,12 @@ void ed::EditorContext::UpdateNodeState(Node* node)
node->m_Bounds.Min = settings->m_Location;
node->m_Bounds.Max = node->m_Bounds.Min + settings->m_Size;
- node->m_Bounds.Floor();
+ node->m_Bounds.Min = ImFloor(node->m_Bounds.Min);
+ node->m_Bounds.Max = ImFloor(node->m_Bounds.Max);
node->m_GroupBounds.Min = settings->m_Location;
node->m_GroupBounds.Max = node->m_GroupBounds.Min + settings->m_GroupSize;
- node->m_GroupBounds.Floor();
+ node->m_GroupBounds.Min = ImFloor(node->m_GroupBounds.Min);
+ node->m_GroupBounds.Max = ImFloor(node->m_GroupBounds.Max);
}
void ed::EditorContext::RemoveSettings(Object* object)
@@ -3785,7 +3789,8 @@ bool ed::SizeAction::Process(const Control& control)
if ((m_Pivot & NodeRegion::Right) == NodeRegion::Right)
newBounds.Max.x = ImMax(newBounds.Min.x + minimumSize.x, Editor->AlignPointToGrid(newBounds.Max.x + dragOffset.x));
- newBounds.Floor();
+ newBounds.Min = ImFloor(newBounds.Min);
+ newBounds.Max = ImFloor(newBounds.Max);
m_LastSize = newBounds.GetSize();
@@ -5308,7 +5313,8 @@ void ed::NodeBuilder::End()
ImGui::EndGroup();
m_NodeRect = ImGui_GetItemRect();
- m_NodeRect.Floor();
+ m_NodeRect.Min = ImFloor(m_NodeRect.Min);
+ m_NodeRect.Max = ImFloor(m_NodeRect.Max);
if (m_CurrentNode->m_Bounds.GetSize() != m_NodeRect.GetSize())
{
@@ -5416,7 +5422,8 @@ void ed::NodeBuilder::PinRect(const ImVec2& a, const ImVec2& b)
IM_ASSERT(nullptr != m_CurrentPin);
m_CurrentPin->m_Bounds = ImRect(a, b);
- m_CurrentPin->m_Bounds.Floor();
+ m_CurrentPin->m_Bounds.Min = ImFloor(m_CurrentPin->m_Bounds.Min);
+ m_CurrentPin->m_Bounds.Max = ImFloor(m_CurrentPin->m_Bounds.Max);
m_ResolvePinRect = false;
}
@@ -5466,7 +5473,8 @@ void ed::NodeBuilder::Group(const ImVec2& size)
ImGui::Dummy(size);
m_GroupBounds = ImGui_GetItemRect();
- m_GroupBounds.Floor();
+ m_GroupBounds.Min = ImFloor(m_GroupBounds.Min);
+ m_GroupBounds.Max = ImFloor(m_GroupBounds.Max);
}
ImDrawList* ed::NodeBuilder::GetUserBackgroundDrawList() const

View File

@ -9,9 +9,11 @@ vcpkg_from_github(
PATCHES
fix-vec2-math-operators.patch
remove-getkeyindex.patch # GetKeyIndex() is a no-op since 1.87; see https://github.com/ocornut/imgui/issues/5979#issuecomment-1345349492
fix-imgui-v1.92.5.patch
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
file(REMOVE_RECURSE "${SOURCE_PATH}/external/imgui")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"

View File

@ -1,7 +1,7 @@
{
"name": "imgui-node-editor",
"version": "0.9.3",
"port-version": 2,
"port-version": 3,
"description": "Node Editor built using Dear ImGui",
"homepage": "https://github.com/thedmd/imgui-node-editor",
"license": "MIT",

View File

@ -0,0 +1,216 @@
diff --git a/imgui-SFML.cpp b/imgui-SFML.cpp
index 6641244..7bd812f 100644
--- a/imgui-SFML.cpp
+++ b/imgui-SFML.cpp
@@ -1,4 +1,5 @@
#include "imgui-SFML.h"
+#include <cstdint>
#include <imgui.h>
#include <SFML/Config.hpp>
@@ -313,6 +314,7 @@ bool Init(sf::Window& window, const sf::Vector2f& displaySize, bool loadDefaultF
io.BackendFlags |= ImGuiBackendFlags_HasGamepad;
io.BackendFlags |= ImGuiBackendFlags_HasMouseCursors;
io.BackendFlags |= ImGuiBackendFlags_HasSetMousePos;
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasTextures;
io.BackendPlatformName = "imgui_impl_sfml";
s_currWindowCtx->joystickId = getConnectedJoystickId();
@@ -338,13 +340,6 @@ bool Init(sf::Window& window, const sf::Vector2f& displaySize, bool loadDefaultF
loadMouseCursor(ImGuiMouseCursor_ResizeNWSE, sf::Cursor::Type::SizeTopLeftBottomRight);
loadMouseCursor(ImGuiMouseCursor_Hand, sf::Cursor::Type::Hand);
- if (loadDefaultFont)
- {
- // this will load default font automatically
- // No need to call AddDefaultFont
- return UpdateFontTexture();
- }
-
return true;
}
@@ -589,6 +584,15 @@ void Shutdown(const sf::Window& window)
{
const bool needReplacement = (s_currWindowCtx->window->getNativeHandle() == window.getNativeHandle());
+ for (ImTextureData* tex : ImGui::GetPlatformIO().Textures)
+ {
+ if (tex->RefCount == 1)
+ {
+ tex->SetStatus(ImTextureStatus_WantDestroy);
+ UpdateFontTexture(tex);
+ }
+ }
+
// remove window's context
auto found = std::find_if(s_windowContexts.begin(),
s_windowContexts.end(),
@@ -619,37 +623,55 @@ void Shutdown(const sf::Window& window)
void Shutdown()
{
+ for (ImTextureData* tex : ImGui::GetPlatformIO().Textures)
+ {
+ if (tex->RefCount == 1)
+ {
+ tex->SetStatus(ImTextureStatus_WantDestroy);
+ UpdateFontTexture(tex);
+ }
+ }
s_currWindowCtx = nullptr;
ImGui::SetCurrentContext(nullptr);
s_windowContexts.clear();
}
-bool UpdateFontTexture()
+void UpdateFontTexture(ImTextureData* tex)
{
assert(s_currWindowCtx);
- ImGuiIO& io = ImGui::GetIO();
- unsigned char* pixels = nullptr;
- int width = 0;
- int height = 0;
-
- io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height);
-
- sf::Texture newTexture;
- if (!newTexture.resize(sf::Vector2u(sf::Vector2(width, height))))
+ if (tex->Status == ImTextureStatus_WantCreate)
{
- return false;
+ auto sfml_texture = std::make_unique<sf::Texture>();
+ [[maybe_unused]] auto res = sfml_texture->resize(sf::Vector2u(sf::Vector2(tex->Width, tex->Height)));
+ sfml_texture->update(reinterpret_cast<std::uint8_t*>(tex->GetPixels()));
+ ImTextureID id = convertGLTextureHandleToImTextureID(sfml_texture->getNativeHandle());
+ tex->SetTexID(id);
+ textureMap[id] = std::move(sfml_texture);
+ tex->SetStatus(ImTextureStatus_OK);
}
+ else if (tex->Status == ImTextureStatus_WantUpdates)
+ {
+ auto it = textureMap.find(tex->GetTexID());
+ if (it != textureMap.end()) {
+ for (ImTextureRect& r : tex->Updates)
+ {
+ it->second->update(
+ reinterpret_cast<std::uint8_t*>(tex->GetPixelsAt(r.x, r.y)),
+ sf::Vector2u(sf::Vector2(r.w, r.h)),
+ sf::Vector2u(sf::Vector2(r.x, r.y)));
+ tex->SetStatus(ImTextureStatus_OK);
+ }
- newTexture.update(pixels);
-
- ImTextureID texID = convertGLTextureHandleToImTextureID(newTexture.getNativeHandle());
- io.Fonts->SetTexID(texID);
-
- s_currWindowCtx->fontTexture = std::move(newTexture);
-
- return true;
+ }
+ }
+ else
+ {
+ tex->SetTexID(ImTextureID_Invalid);
+ tex->SetStatus(ImTextureStatus_Destroyed);
+ textureMap.erase(tex->GetTexID());
+ }
}
std::optional<sf::Texture>& GetFontTexture()
@@ -776,7 +798,7 @@ void Image(const sf::Texture& texture, const sf::Vector2f& size, const sf::Color
{
ImTextureID textureID = convertGLTextureHandleToImTextureID(texture.getNativeHandle());
- ImGui::Image(textureID, toImVec2(size), ImVec2(0, 0), ImVec2(1, 1), toImColor(tintColor), toImColor(borderColor));
+ ImGui::ImageWithBg(textureID, toImVec2(size), ImVec2(0, 0), ImVec2(1, 1), toImColor(tintColor), toImColor(borderColor));
}
/////////////// Image Overloads for sf::RenderTexture
@@ -789,7 +811,7 @@ void Image(const sf::RenderTexture& texture, const sf::Vector2f& size, const sf:
{
ImTextureID textureID = convertGLTextureHandleToImTextureID(texture.getTexture().getNativeHandle());
- ImGui::Image(textureID,
+ ImGui::ImageWithBg(textureID,
toImVec2(size),
ImVec2(0, 1),
ImVec2(1, 0), // flipped vertically,
@@ -810,7 +832,7 @@ void Image(const sf::Sprite& sprite, const sf::Color& tintColor, const sf::Color
void Image(const sf::Sprite& sprite, const sf::Vector2f& size, const sf::Color& tintColor, const sf::Color& borderColor)
{
auto [uv0, uv1, textureID] = getSpriteTextureData(sprite);
- ImGui::Image(textureID, toImVec2(size), uv0, uv1, toImColor(tintColor), toImColor(borderColor));
+ ImGui::ImageWithBg(textureID, toImVec2(size), uv0, uv1, toImColor(tintColor), toImColor(borderColor));
}
/////////////// Image Button Overloads for sf::Texture
@@ -946,14 +968,11 @@ void SetupRenderState(ImDrawData* draw_data, int fb_width, int fb_height)
// Rendering callback
void RenderDrawLists(ImDrawData* draw_data)
{
- ImGui::GetDrawData();
- if (draw_data->CmdListsCount == 0)
- {
- return;
- }
-
- const ImGuiIO& io = ImGui::GetIO();
- assert(io.Fonts->TexID != (ImTextureID) nullptr); // You forgot to create and set font texture
+ auto& io = ImGui::GetIO();
+ if (draw_data->Textures != nullptr)
+ for (ImTextureData* tex : *draw_data->Textures)
+ if (tex->Status != ImTextureStatus_OK)
+ ImGui::SFML::UpdateFontTexture(tex);
// Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates !=
// framebuffer coordinates)
@@ -1040,7 +1059,7 @@ void RenderDrawLists(ImDrawData* draw_data)
(int)(clip_rect.w - clip_rect.y));
// Bind texture, Draw
- const GLuint textureHandle = convertImTextureIDToGLTextureHandle(pcmd->TextureId);
+ const GLuint textureHandle = (GLuint)(intptr_t)pcmd->GetTexID();
glBindTexture(GL_TEXTURE_2D, textureHandle);
glDrawElements(GL_TRIANGLES,
(GLsizei)pcmd->ElemCount,
diff --git a/imgui-SFML.h b/imgui-SFML.h
index ee873f6..e0d15aa 100644
--- a/imgui-SFML.h
+++ b/imgui-SFML.h
@@ -6,10 +6,14 @@
#include <SFML/System/Time.hpp>
#include <SFML/System/Vector2.hpp>
#include <SFML/Window/Joystick.hpp>
+#include <SFML/Graphics/Texture.hpp>
#include <optional>
#include "imgui-SFML_export.h"
+#include "imgui.h" // IMGUI_IMPL_API
+#include <unordered_map>
+#include <memory>
namespace sf
{
@@ -26,6 +30,8 @@ namespace ImGui
{
namespace SFML
{
+ inline std::unordered_map<ImTextureID, std::unique_ptr<sf::Texture>> textureMap;
+
[[nodiscard]] IMGUI_SFML_API bool Init(sf::RenderWindow& window, bool loadDefaultFont = true);
[[nodiscard]] IMGUI_SFML_API bool Init(sf::Window& window, sf::RenderTarget& target, bool loadDefaultFont = true);
[[nodiscard]] IMGUI_SFML_API bool Init(sf::Window& window, const sf::Vector2f& displaySize, bool loadDefaultFont = true);
@@ -45,7 +51,7 @@ IMGUI_SFML_API void Shutdown(const sf::Window& window);
// Shuts down all ImGui contexts
IMGUI_SFML_API void Shutdown();
-[[nodiscard]] IMGUI_SFML_API bool UpdateFontTexture();
+IMGUI_SFML_API void UpdateFontTexture(ImTextureData* tex);
IMGUI_SFML_API std::optional<sf::Texture>& GetFontTexture();
// joystick functions

View File

@ -8,6 +8,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
0001-fix_find_package.patch
0002-support-imgui-1.92.patch # https://github.com/SFML/imgui-sfml/pull/330
)
vcpkg_cmake_configure(

View File

@ -1,10 +1,11 @@
{
"name": "imgui-sfml",
"version": "3.0",
"port-version": 2,
"port-version": 3,
"description": "ImGui binding for use with SFML",
"homepage": "https://github.com/eliasdaler/imgui-sfml",
"license": "MIT",
"supports": "!android",
"dependencies": [
"imgui",
"opengl",

View File

@ -80,6 +80,14 @@ if(IMGUI_BUILD_OPENGL2_BINDING)
endif()
if(IMGUI_BUILD_OPENGL3_BINDING)
if(APPLE AND (CMAKE_SYSTEM_NAME MATCHES "iOS"))
target_compile_definitions(${PROJECT_NAME} PRIVATE IMGUI_IMPL_OPENGL_ES3)
target_link_libraries(${PROJECT_NAME} PUBLIC -framework OpenGLES)
elseif(ANDROID)
target_compile_definitions(${PROJECT_NAME} PRIVATE IMGUI_IMPL_OPENGL_ES3)
find_path(OPENGL_INCLUDE_DIR NAMES GLES3/gl3.h REQUIRED)
target_include_directories(${PROJECT_NAME} PRIVATE ${OPENGL_INCLUDE_DIR})
endif()
target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/backends/imgui_impl_opengl3.cpp)
endif()
@ -115,6 +123,18 @@ if(IMGUI_BUILD_WIN32_BINDING)
target_sources(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/backends/imgui_impl_win32.cpp)
endif()
if(IMGUI_BUILD_WEBGPU_BINDING)
find_package(Dawn CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC dawn::webgpu_dawn)
target_compile_definitions(${PROJECT_NAME} PRIVATE IMGUI_IMPL_WEBGPU_BACKEND_DAWN)
list(APPEND WGPU_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/backends/imgui_impl_wgpu.cpp)
target_sources(${PROJECT_NAME} PRIVATE ${WGPU_SRCS})
if(APPLE)
set_source_files_properties(${WGPU_SRCS} PROPERTIES LANGUAGE OBJCXX)
target_link_libraries(${PROJECT_NAME} PUBLIC "-framework Foundation")
endif()
endif()
if(IMGUI_FREETYPE)
find_package(freetype CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC freetype)
@ -261,6 +281,10 @@ if(NOT IMGUI_SKIP_HEADERS)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/backends/imgui_impl_win32.h DESTINATION include)
endif()
if(IMGUI_BUILD_WEBGPU_BINDING)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/backends/imgui_impl_wgpu.h DESTINATION include)
endif()
if(IMGUI_FREETYPE)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/misc/freetype/imgui_freetype.h DESTINATION include)
endif()

View File

@ -22,6 +22,10 @@ if (@IMGUI_BUILD_VULKAN_BINDING@)
find_dependency(Vulkan)
endif()
if (@IMGUI_BUILD_WEBGPU_BINDING@)
find_dependency(Dawn)
endif()
if (@IMGUI_FREETYPE@)
find_dependency(freetype CONFIG)
endif()

View File

@ -5,7 +5,7 @@ if ("docking-experimental" IN_LIST FEATURES)
OUT_SOURCE_PATH SOURCE_PATH
REPO ocornut/imgui
REF "v${VERSION}-docking"
SHA512 3a019533e638b2023e0c71d0455561ee9d589ff33b677c8135345e85c28edb7b83580271d49a787e0e838fd6217d1625baad65e6559ae7faec53f3a309917ecd
SHA512 14cf795a95deb8f3ba45c2eed3c26584b713c0cf17e01939a372c033c344ba78ddfa4d0d63619243b639779aa1eacf452771d1b6a1d9b80d13f8cc4d0b9d8e6d
HEAD_REF docking
)
else()
@ -13,7 +13,7 @@ else()
OUT_SOURCE_PATH SOURCE_PATH
REPO ocornut/imgui
REF "v${VERSION}"
SHA512 c9393bd9f6b49b036ad6ab3ba4d972876c6f60ce7f5c13a7a56ff11b3559ea3211b0caa03eed10b4f4fbe9c371e14f7f24866bd476652f543f3ed3aa878ea930
SHA512 1742eaa4811fc63f4ed3804ecd6970cbc0a960c85014903e302ab082ccf7ff7488d534bd4cb7a6d7c2a71824cb80d6c9923ea5a4951190941121cf1b05e3df9d
HEAD_REF master
)
endif()
@ -40,6 +40,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
sdl3-renderer-binding IMGUI_BUILD_SDL3_RENDERER_BINDING
vulkan-binding IMGUI_BUILD_VULKAN_BINDING
win32-binding IMGUI_BUILD_WIN32_BINDING
webgpu-binding IMGUI_BUILD_WEBGPU_BINDING
freetype IMGUI_FREETYPE
freetype-svg IMGUI_FREETYPE_SVG
wchar32 IMGUI_USE_WCHAR32
@ -64,7 +65,7 @@ if ("test-engine" IN_LIST FEATURES)
OUT_SOURCE_PATH TEST_ENGINE_SOURCE_PATH
REPO ocornut/imgui_test_engine
REF "v${VERSION}"
SHA512 44d6fd1c26c9c2cb3fcbd1560dba8e056f84dc170051dcb8db5d642945fb26475006a8166486f7f62e900a97d65f2f98d364ac06c121a57309b3229cc41556a4
SHA512 f125ed5e8345fa9c7e9761ad738c68e2b51bd7cfe338dbb1bb4235d65f9430dc1555beb1f12409941ad5f1c8580409b11bd52db3b159a3d08a61000507900104
HEAD_REF master
)

View File

@ -1,6 +1,6 @@
{
"name": "imgui",
"version": "1.91.9",
"version": "1.92.6",
"description": "Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies.",
"homepage": "https://github.com/ocornut/imgui",
"license": "MIT",
@ -91,7 +91,7 @@
},
"opengl2-binding": {
"description": "Make available OpenGL (legacy) binding",
"supports": "!uwp"
"supports": "!(uwp | android)"
},
"opengl3-binding": {
"description": "Make available OpenGL3/ES/ES2 (modern) binding"
@ -141,6 +141,12 @@
"wchar32": {
"description": "Use WCHAR32 instead of WCHAR16"
},
"webgpu-binding": {
"description": "Make available WebGPU binding",
"dependencies": [
"dawn"
]
},
"win32-binding": {
"description": "Make available Win32 binding",
"supports": "windows & !uwp"

View File

@ -0,0 +1,88 @@
diff --git a/GraphEditor.cpp b/GraphEditor.cpp
index f75fdd9..c7fde15 100644
--- a/GraphEditor.cpp
+++ b/GraphEditor.cpp
@@ -837,7 +837,7 @@ void Show(Delegate& delegate, const Options& options, ViewState& viewState, bool
captureOffset = viewState.mPosition * viewState.mFactor;
//ImGui::InvisibleButton("GraphEditorButton", canvasSize);
- ImGui::BeginChildFrame(71711, canvasSize);
+ ImGui::BeginChild(71711, canvasSize, ImGuiChildFlags_FrameStyle);
ImGui::SetCursorPos(windowPos);
ImGui::BeginGroup();
@@ -1030,7 +1030,7 @@ void Show(Delegate& delegate, const Options& options, ViewState& viewState, bool
ImGui::PopStyleColor(1);
ImGui::PopStyleVar(2);
ImGui::EndGroup();
- ImGui::EndChildFrame();
+ ImGui::EndChild();
ImGui::PopStyleVar(3);
diff --git a/ImCurveEdit.cpp b/ImCurveEdit.cpp
index f0d5a97..6914af0 100644
--- a/ImCurveEdit.cpp
+++ b/ImCurveEdit.cpp
@@ -148,7 +148,7 @@ namespace ImCurveEdit
ImGuiIO& io = ImGui::GetIO();
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
ImGui::PushStyleColor(ImGuiCol_Border, 0);
- ImGui::BeginChildFrame(id, size);
+ ImGui::BeginChild(id, size, ImGuiChildFlags_FrameStyle);
delegate.focused = ImGui::IsWindowFocused();
ImDrawList* draw_list = ImGui::GetWindowDrawList();
if (clippingRect)
@@ -441,7 +441,7 @@ namespace ImCurveEdit
if (clippingRect)
draw_list->PopClipRect();
- ImGui::EndChildFrame();
+ ImGui::EndChild();
ImGui::PopStyleVar();
ImGui::PopStyleColor(1);
diff --git a/ImGradient.cpp b/ImGradient.cpp
index 734200e..8fce078 100644
--- a/ImGradient.cpp
+++ b/ImGradient.cpp
@@ -67,7 +67,7 @@ namespace ImGradient
bool ret = false;
ImGuiIO& io = ImGui::GetIO();
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
- ImGui::BeginChildFrame(137, size);
+ ImGui::BeginChild(137, size, ImGuiChildFlags_FrameStyle);
ImDrawList* draw_list = ImGui::GetWindowDrawList();
const ImVec2 offset = ImGui::GetCursorScreenPos();
@@ -107,7 +107,7 @@ namespace ImGradient
delegate.AddPoint(delegate.GetPoint(t));
ret = true;
}
- ImGui::EndChildFrame();
+ ImGui::EndChild();
ImGui::PopStyleVar();
selection = currentSelection;
diff --git a/ImSequencer.cpp b/ImSequencer.cpp
index aff7729..3a0c8e8 100644
--- a/ImSequencer.cpp
+++ b/ImSequencer.cpp
@@ -162,7 +162,7 @@ namespace ImSequencer
ImVec2 childFramePos = ImGui::GetCursorScreenPos();
ImVec2 childFrameSize(canvas_size.x, canvas_size.y - 8.f - headerSize.y - (hasScrollBar ? scrollBarSize.y : 0));
ImGui::PushStyleColor(ImGuiCol_FrameBg, 0);
- ImGui::BeginChildFrame(889, childFrameSize);
+ ImGui::BeginChild(890, childFrameSize, ImGuiChildFlags_FrameStyle);
sequence->focused = ImGui::IsWindowFocused();
ImGui::InvisibleButton("contentBar", ImVec2(canvas_size.x, float(controlHeight)));
const ImVec2 contentMin = ImGui::GetItemRectMin();
@@ -511,7 +511,7 @@ namespace ImSequencer
}
//
- ImGui::EndChildFrame();
+ ImGui::EndChild();
ImGui::PopStyleColor();
if (hasScrollBar)
{

View File

@ -6,6 +6,8 @@ vcpkg_from_github(
REF ba662b119d64f9ab700bb2cd7b2781f9044f5565
SHA512 682d785b582379914d525985de3a0bc04932b4ed715607127b1803ffba4d9b85165255dca1c18d2fd0934bab43de5d6c9c2d9909ac84d0ddaea12dad1871bcf8
HEAD_REF master
PATCHES
fix-imgui-1.92.5.patch
)
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")

View File

@ -1,7 +1,7 @@
{
"name": "imguizmo",
"version-date": "2024-05-29",
"port-version": 1,
"port-version": 2,
"description": "Immediate mode 3D gizmo for scene editing and other controls based on Dear ImGui",
"homepage": "https://github.com/CedricGuillemet/ImGuizmo",
"license": "MIT",

View File

@ -0,0 +1,22 @@
diff --git a/src/vsgImGui/RenderImGui.cpp b/src/vsgImGui/RenderImGui.cpp
index e3f1ad3..354fbdb 100644
--- a/src/vsgImGui/RenderImGui.cpp
+++ b/src/vsgImGui/RenderImGui.cpp
@@ -176,7 +176,7 @@ void RenderImGui::_init(
init_info.QueueFamily = _queueFamily;
init_info.Queue = *(_queue); // ImGui doesn't use the queue so we shouldn't need to assign it, but it has an IM_ASSERT requiring it during debug build.
init_info.PipelineCache = VK_NULL_HANDLE;
- init_info.MSAASamples = samples;
+ init_info.PipelineInfoMain.MSAASamples = samples;
// Create Descriptor Pool
vsg::DescriptorPoolSizes pool_sizes = {
@@ -196,7 +196,7 @@ void RenderImGui::_init(
_descriptorPool = vsg::DescriptorPool::create(_device, maxSets, pool_sizes);
init_info.DescriptorPool = *_descriptorPool;
- init_info.RenderPass = *renderPass;
+ init_info.PipelineInfoMain.RenderPass = *renderPass;
init_info.Allocator = nullptr;
init_info.MinImageCount = std::max(minImageCount, 2u); // ImGui's Vulkan backend has an assert that requires MinImageCount to be 2 or more.
init_info.ImageCount = imageCount;

View File

@ -7,6 +7,7 @@ vcpkg_from_github(
PATCHES
devendor.patch
remove-manual-font-creation.patch
fix-imgui-1.92.5.patch
)
file(REMOVE "${SOURCE_PATH}/include/vsgImGui/imgui.h")

View File

@ -1,6 +1,7 @@
{
"name": "vsgimgui",
"version": "0.7.0",
"port-version": 1,
"description": "Library that integrates VulkanSceneGraph with Dear ImGui & ImPlot.",
"homepage": "https://github.com/vsg-dev/vsgImGui",
"license": "MIT",

View File

@ -277,9 +277,6 @@ gz-tools:arm-neon-android=fail
gz-tools:arm64-android=fail
gz-tools:x64-android=fail
halide:x64-windows-static=fail
hello-imgui:arm-neon-android=fail
hello-imgui:arm64-android=fail
hello-imgui:x64-android=fail
hexl:x64-android=fail
hwloc:arm-neon-android=fail
hwloc:arm64-android=fail

View File

@ -504,16 +504,12 @@ igraph[openmp]:arm64-osx=feature-fails # openmp setup needed
ijg-libjpeg:arm64-linux=skip
imcce-openfa:arm64-linux=fail
imgui[allegro5-binding]:arm64-linux=cascade
imgui[allegro5-binding]:arm64-windows=cascade
imgui[glfw-binding]:arm64-linux=cascade
imgui[glut-binding]:arm64-linux=cascade
imgui[sdl3-binding]:arm64-linux=cascade
imgui[sdl3-renderer-binding]:arm64-linux=cascade
imgui[sdlgpu3-binding]:arm64-linux=cascade
imgui-sfml:arm-neon-android=fail
imgui-sfml:arm64-android=fail
imgui-sfml:arm64-linux=cascade
imgui-sfml:x64-android=fail
infoware[opengl]:arm64-linux=feature-fails
infoware[x11]:arm64-linux=feature-fails
irrlicht[tools]:arm64-linux=feature-fails

View File

@ -0,0 +1,34 @@
diff --git a/examples/example_glfw_wgpu/CMakeLists.txt b/examples/example_glfw_wgpu/CMakeLists.txt
index 11248df..f34d704 100644
--- a/examples/example_glfw_wgpu/CMakeLists.txt
+++ b/examples/example_glfw_wgpu/CMakeLists.txt
@@ -35,20 +35,11 @@ endif()
set(CMAKE_CXX_STANDARD 17) # Dawn requires C++17
# Dear ImGui
-set(IMGUI_DIR ../../)
+find_package(imgui CONFIG REQUIRED)
set(IMGUI_EXAMPLE_SOURCE_FILES
# Example code
main.cpp
- # Dear ImGui Backend files
- ${IMGUI_DIR}/backends/imgui_impl_glfw.cpp
- ${IMGUI_DIR}/backends/imgui_impl_wgpu.cpp
- # Dear ImGui files
- ${IMGUI_DIR}/imgui.cpp
- ${IMGUI_DIR}/imgui_draw.cpp
- ${IMGUI_DIR}/imgui_demo.cpp
- ${IMGUI_DIR}/imgui_tables.cpp
- ${IMGUI_DIR}/imgui_widgets.cpp
)
if(EMSCRIPTEN)
@@ -147,6 +138,7 @@ else() # Native/Desktop build
endif()
add_executable(${IMGUI_EXECUTABLE} ${IMGUI_EXAMPLE_SOURCE_FILES})
+target_link_libraries(${IMGUI_EXECUTABLE} PRIVATE imgui::imgui)
target_include_directories(${IMGUI_EXECUTABLE} PUBLIC
${IMGUI_DIR}

View File

@ -1 +1,20 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
# https://github.com/ocornut/imgui/tree/v1.92.5/examples/example_glfw_wgpu
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ocornut/imgui
REF v1.92.6
SHA512 1742eaa4811fc63f4ed3804ecd6970cbc0a960c85014903e302ab082ccf7ff7488d534bd4cb7a6d7c2a71824cb80d6c9923ea5a4951190941121cf1b05e3df9d
HEAD_REF master
PATCHES
# use find_package(imgui) instead of source file list
fix-examples.patch
)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}/examples/example_glfw_wgpu"
OPTIONS
"-DIMGUI_DAWN_DIR=${CURRENT_INSTALLED_DIR}"
)
vcpkg_cmake_build()

View File

@ -1,7 +1,7 @@
{
"name": "vcpkg-ci-imgui",
"version-date": "2024-05-17",
"description": "Force test-engine feature of imgui within vcpkg CI",
"version-string": "ci",
"description": "Port to validate imgui features within CI",
"homepage": "https://github.com/microsoft/vcpkg",
"license": "MIT",
"dependencies": [
@ -10,6 +10,24 @@
"features": [
"test-engine"
]
},
{
"name":"glfw3",
"features": [
"wayland"
],
"platform": "linux"
},
{
"name": "imgui",
"features": [
"glfw-binding",
"webgpu-binding"
]
},
{
"name": "vcpkg-cmake",
"host": true
}
]
}

View File

@ -2358,7 +2358,7 @@
},
"dartsim": {
"baseline": "6.15.0",
"port-version": 6
"port-version": 7
},
"dataframe": {
"baseline": "4.0.0",
@ -3753,8 +3753,8 @@
"port-version": 0
},
"hello-imgui": {
"baseline": "1.6.0",
"port-version": 3
"baseline": "1.92.5",
"port-version": 0
},
"hesphoros-uniconv": {
"baseline": "3.3.2",
@ -3929,20 +3929,20 @@
"port-version": 0
},
"imgui": {
"baseline": "1.91.9",
"baseline": "1.92.6",
"port-version": 0
},
"imgui-node-editor": {
"baseline": "0.9.3",
"port-version": 2
"port-version": 3
},
"imgui-sfml": {
"baseline": "3.0",
"port-version": 2
"port-version": 3
},
"imguizmo": {
"baseline": "2024-05-29",
"port-version": 1
"port-version": 2
},
"immer": {
"baseline": "0.9.1",
@ -10518,7 +10518,7 @@
},
"vsgimgui": {
"baseline": "0.7.0",
"port-version": 0
"port-version": 1
},
"vsgqt": {
"baseline": "0.4.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "90526832e0156a48826b156d5675b54a43720f09",
"version": "6.15.0",
"port-version": 7
},
{
"git-tree": "8923c1b29c08a783df07c025b20f3cc366cd849f",
"version": "6.15.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "20f1d89dc89a4c1730f4e31135f8ed3de6084fbc",
"version": "1.92.5",
"port-version": 0
},
{
"git-tree": "78ac4b6bc7b6c824cb961ef178de22f621631b03",
"version": "1.6.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "0d6ac41280085ce41ea4b866e22dd9abdd8d68fa",
"version": "0.9.3",
"port-version": 3
},
{
"git-tree": "446e26cb985e934f08a574f8a5df27fa905655f6",
"version": "0.9.3",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "b222b58f6532973e2552626f2b7ccf67b36ab93e",
"version": "3.0",
"port-version": 3
},
{
"git-tree": "ae4b886823d6b123e94a3fbf120fcf571f81494b",
"version": "3.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "7e6a11bf1f9d01f199f4a9b8076b1f01252b66ad",
"version": "1.92.6",
"port-version": 0
},
{
"git-tree": "cecad336497c19491c07fead1897ac139a173ed2",
"version": "1.91.9",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "bd616ed69a9c82a561a23ea1afcd9eedd1bb5839",
"version-date": "2024-05-29",
"port-version": 2
},
{
"git-tree": "febc8a87c4fbc76155d002254572154b44b3d850",
"version-date": "2024-05-29",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "98a71baf97be6e3e11753e3cdd0801ec844fcdf1",
"version": "0.7.0",
"port-version": 1
},
{
"git-tree": "9200de3d696659de20b6a8fd62f393baa078fcbc",
"version": "0.7.0",