From b066c5efc0072e2fa621d7f6ea824a04c34bf1a2 Mon Sep 17 00:00:00 2001 From: Nicholas Sharp Date: Tue, 29 Apr 2025 19:24:16 -0700 Subject: [PATCH] update imgui to v1.91.9b --- deps/imgui/imgui | 2 +- src/color_image_quantity.cpp | 5 +++-- src/histogram.cpp | 2 +- src/imgui_config.cpp | 2 +- src/render/engine.cpp | 2 +- src/scalar_image_quantity.cpp | 3 ++- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/deps/imgui/imgui b/deps/imgui/imgui index 277ae93c4..f5befd2d2 160000 --- a/deps/imgui/imgui +++ b/deps/imgui/imgui @@ -1 +1 @@ -Subproject commit 277ae93c41314ba5f4c7444f37c4319cdf07e8cf +Subproject commit f5befd2d29e66809cd1110a152e375a7f1981f06 diff --git a/src/color_image_quantity.cpp b/src/color_image_quantity.cpp index 99089473d..c6f14565c 100644 --- a/src/color_image_quantity.cpp +++ b/src/color_image_quantity.cpp @@ -107,9 +107,10 @@ void ColorImageQuantity::showInImGuiWindow() { // since we are showing directly from the user's texture, we need to resposect the upper left ordering if (imageOrigin == ImageOrigin::LowerLeft) { - ImGui::Image(colors.getRenderTextureBuffer()->getNativeHandle(), ImVec2(w, h), ImVec2(0, 1), ImVec2(1, 0)); + ImGui::Image((ImTextureID)(intptr_t)colors.getRenderTextureBuffer()->getNativeHandle(), ImVec2(w, h), ImVec2(0, 1), + ImVec2(1, 0)); } else if (imageOrigin == ImageOrigin::UpperLeft) { - ImGui::Image(colors.getRenderTextureBuffer()->getNativeHandle(), ImVec2(w, h)); + ImGui::Image((ImTextureID)(intptr_t)colors.getRenderTextureBuffer()->getNativeHandle(), ImVec2(w, h)); } render::engine->preserveResourceUntilImguiFrameCompletes(colors.getRenderTextureBuffer()); diff --git a/src/histogram.cpp b/src/histogram.cpp index 42e2bdb18..12394e62b 100644 --- a/src/histogram.cpp +++ b/src/histogram.cpp @@ -201,7 +201,7 @@ void Histogram::buildUI(float width) { float h = w / aspect; // Render image - ImGui::Image(texture->getNativeHandle(), ImVec2(w, h), ImVec2(0, 1), ImVec2(1, 0)); + ImGui::Image((ImTextureID)(intptr_t)texture->getNativeHandle(), ImVec2(w, h), ImVec2(0, 1), ImVec2(1, 0)); render::engine->preserveResourceUntilImguiFrameCompletes(texture); // Helpful info for drawing annotations below diff --git a/src/imgui_config.cpp b/src/imgui_config.cpp index bc6df1431..7b87f0002 100644 --- a/src/imgui_config.cpp +++ b/src/imgui_config.cpp @@ -68,7 +68,7 @@ void configureImGuiStyle() { colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f); colors[ImGuiCol_Tab] = ImVec4(0.27f, 0.54f, 0.42f, 0.83f); colors[ImGuiCol_TabHovered] = ImVec4(0.34f, 0.68f, 0.53f, 0.83f); - colors[ImGuiCol_TabActive] = ImVec4(0.38f, 0.76f, 0.58f, 0.83f); + colors[ImGuiCol_TabSelected] = ImVec4(0.38f, 0.76f, 0.58f, 0.83f); } diff --git a/src/render/engine.cpp b/src/render/engine.cpp index 819eb9596..037af3797 100644 --- a/src/render/engine.cpp +++ b/src/render/engine.cpp @@ -1176,7 +1176,7 @@ void Engine::showTextureInImGuiWindow(std::string windowName, TextureBuffer* buf float h = w * buffer->getSizeY() / buffer->getSizeX(); ImGui::Text("Dimensions: %dx%d", buffer->getSizeX(), buffer->getSizeY()); - ImGui::Image(buffer->getNativeHandle(), ImVec2(w, h), ImVec2(0, 1), ImVec2(1, 0)); + ImGui::Image((ImTextureID)(intptr_t)buffer->getNativeHandle(), ImVec2(w, h), ImVec2(0, 1), ImVec2(1, 0)); ImGui::End(); } diff --git a/src/scalar_image_quantity.cpp b/src/scalar_image_quantity.cpp index eb5641bfa..ef3c74c9e 100644 --- a/src/scalar_image_quantity.cpp +++ b/src/scalar_image_quantity.cpp @@ -114,7 +114,8 @@ void ScalarImageQuantity::showInImGuiWindow() { // here we always use the same ImVec2 UV coords below, because the texture order is always openGL convention after the // intermediate render pass - ImGui::Image(textureIntermediateRendered->getNativeHandle(), ImVec2(w, h), ImVec2(0, 1), ImVec2(1, 0)); + ImGui::Image((ImTextureID)(intptr_t)textureIntermediateRendered->getNativeHandle(), ImVec2(w, h), ImVec2(0, 1), + ImVec2(1, 0)); render::engine->preserveResourceUntilImguiFrameCompletes(textureIntermediateRendered);