mirror of
https://github.com/izzy2lost/libultraship.git
synced 2026-06-19 01:16:13 -07:00
imgui 1.90.6 -> 1.91.6 (#788)
* imgui 1.90.6 -> 1.91.6 * deal with new `ImTextureID` type in https://github.com/ocornut/imgui/commit/92b94980c69ff3d3d7f5dc30c1c19abfb72db47e `ImTextureID` was updated from `void*` to `ImU64`, which is defined as `unsigned long long` (which conflicts with some implementations of `uint64_t` that have it as `unsigned long`) * metal? * metal?? * d3d11? * change readme to see linux build fail * fix it (bump from 10 to 12) * switch back to `void*` by using a patch to modify `imconfig.h`
This commit is contained in:
@@ -9,15 +9,15 @@ if (CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
endif()
|
||||
|
||||
#=================== ImGui ===================
|
||||
set(sdl_gamepad_patch_file ${CMAKE_CURRENT_SOURCE_DIR}/cmake/dependencies/patches/sdl-gamepad-fix.patch)
|
||||
set(imgui_fixes_and_config_patch_file ${CMAKE_CURRENT_SOURCE_DIR}/cmake/dependencies/patches/imgui-fixes-and-config.patch)
|
||||
|
||||
# Applies the patch or checks if it has already been applied successfully previously. Will error otherwise.
|
||||
set(sdl_apply_patch_if_needed git apply ${sdl_gamepad_patch_file} ${git_hide_output} || git apply --reverse --check ${sdl_gamepad_patch_file})
|
||||
set(imgui_apply_patch_if_needed git apply ${imgui_fixes_and_config_patch_file} ${git_hide_output} || git apply --reverse --check ${imgui_fixes_and_config_patch_file})
|
||||
FetchContent_Declare(
|
||||
ImGui
|
||||
GIT_REPOSITORY https://github.com/ocornut/imgui.git
|
||||
GIT_TAG v1.90.6-docking
|
||||
PATCH_COMMAND ${sdl_apply_patch_if_needed}
|
||||
GIT_TAG v1.91.6-docking
|
||||
PATCH_COMMAND ${imgui_apply_patch_if_needed}
|
||||
)
|
||||
FetchContent_MakeAvailable(ImGui)
|
||||
list(APPEND ADDITIONAL_LIB_INCLUDES ${imgui_SOURCE_DIR} ${imgui_SOURCE_DIR}/backends)
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
From 7cd9b89560b66b992db9fd0e620c2d28ad9a9645 Mon Sep 17 00:00:00 2001
|
||||
From: briaguya <70942617+briaguya-ai@users.noreply.github.com>
|
||||
Date: Fri, 10 Jan 2025 04:48:50 -0500
|
||||
Subject: [PATCH 1/2] sdl gamepad fix
|
||||
|
||||
---
|
||||
backends/imgui_impl_sdl2.cpp | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/backends/imgui_impl_sdl2.cpp b/backends/imgui_impl_sdl2.cpp
|
||||
index 23f12796..a7fef045 100644
|
||||
--- a/backends/imgui_impl_sdl2.cpp
|
||||
+++ b/backends/imgui_impl_sdl2.cpp
|
||||
@@ -816,9 +816,6 @@ static void ImGui_ImplSDL2_UpdateGamepads()
|
||||
bd->WantUpdateGamepadsList = false;
|
||||
}
|
||||
|
||||
- // FIXME: Technically feeding gamepad shouldn't depend on this now that they are regular inputs.
|
||||
- if ((io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) == 0)
|
||||
- return;
|
||||
io.BackendFlags &= ~ImGuiBackendFlags_HasGamepad;
|
||||
if (bd->Gamepads.Size == 0)
|
||||
return;
|
||||
--
|
||||
2.47.1
|
||||
|
||||
|
||||
From 635226a311071e80c22e0c58c9cb5c9d950d2e17 Mon Sep 17 00:00:00 2001
|
||||
From: briaguya <70942617+briaguya-ai@users.noreply.github.com>
|
||||
Date: Fri, 10 Jan 2025 04:52:36 -0500
|
||||
Subject: [PATCH 2/2] add config stuff
|
||||
|
||||
---
|
||||
imconfig.h | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/imconfig.h b/imconfig.h
|
||||
index 8f8bc3b9..cc578e3f 100644
|
||||
--- a/imconfig.h
|
||||
+++ b/imconfig.h
|
||||
@@ -111,7 +111,7 @@
|
||||
operator MyVec4() const { return MyVec4(x,y,z,w); }
|
||||
*/
|
||||
//---- ...Or use Dear ImGui's own very basic math operators.
|
||||
-//#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
+#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
|
||||
//---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices.
|
||||
// Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices).
|
||||
@@ -140,3 +140,6 @@ namespace ImGui
|
||||
void MyFunction(const char* name, MyMatrix44* mtx);
|
||||
}
|
||||
*/
|
||||
+
|
||||
+// handle https://github.com/ocornut/imgui/issues/1641 the old way
|
||||
+#define ImTextureID void*
|
||||
--
|
||||
2.47.1
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
backends/imgui_impl_sdl2.cpp | 3 ---
|
||||
1 file changed, 3 deletions(-)
|
||||
|
||||
diff --git a/backends/imgui_impl_sdl2.cpp b/backends/imgui_impl_sdl2.cpp
|
||||
index 569b01d1..c2f84dca 100644
|
||||
--- a/backends/imgui_impl_sdl2.cpp
|
||||
+++ b/backends/imgui_impl_sdl2.cpp
|
||||
@@ -770,9 +770,6 @@ static void ImGui_ImplSDL2_UpdateGamepads()
|
||||
bd->WantUpdateGamepadsList = false;
|
||||
}
|
||||
|
||||
- // FIXME: Technically feeding gamepad shouldn't depend on this now that they are regular inputs.
|
||||
- if ((io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) == 0)
|
||||
- return;
|
||||
io.BackendFlags &= ~ImGuiBackendFlags_HasGamepad;
|
||||
if (bd->Gamepads.Size == 0)
|
||||
return;
|
||||
@@ -4,9 +4,6 @@
|
||||
#include "controller/controldevice/controller/Controller.h"
|
||||
#include "utils/StringHelper.h"
|
||||
#include "public/bridge/consolevariablebridge.h"
|
||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#endif
|
||||
#include <imgui.h>
|
||||
#include "controller/deviceindex/ShipDeviceIndexMappingManager.h"
|
||||
#include "controller/controldevice/controller/mapping/mouse/WheelHandler.h"
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
|
||||
#include "stdint.h"
|
||||
#include "window/gui/GuiWindow.h"
|
||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#endif
|
||||
#include <imgui.h>
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
|
||||
#include "stdint.h"
|
||||
#include "window/gui/GuiWindow.h"
|
||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#endif
|
||||
#include <imgui.h>
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#endif
|
||||
#include <imgui.h>
|
||||
|
||||
namespace Ship {
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
#define GFX_DIRECT3D11_H
|
||||
|
||||
#include "gfx_rendering_api.h"
|
||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#endif
|
||||
#include <imgui.h>
|
||||
|
||||
extern struct GfxRenderingAPI gfx_direct3d11_api;
|
||||
|
||||
@@ -387,12 +387,12 @@ void ConsoleWindow::DrawElement() {
|
||||
ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(.3f, .3f, .3f, 1.0f));
|
||||
if (ImGui::BeginTable("History", 1)) {
|
||||
|
||||
if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow))) {
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_DownArrow)) {
|
||||
if (mSelectedId < (int32_t)mLog.size() - 1) {
|
||||
++mSelectedId;
|
||||
}
|
||||
}
|
||||
if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_UpArrow))) {
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_UpArrow)) {
|
||||
if (mSelectedId > 0) {
|
||||
--mSelectedId;
|
||||
}
|
||||
@@ -415,7 +415,7 @@ void ConsoleWindow::DrawElement() {
|
||||
std::find(mSelectedEntries.begin(), mSelectedEntries.end(), i) != mSelectedEntries.end();
|
||||
ImGui::PushStyleColor(ImGuiCol_Text, mPriorityColours[line.Priority]);
|
||||
if (ImGui::Selectable(id.c_str(), isSelected)) {
|
||||
if (ImGui::IsKeyDown(ImGui::GetKeyIndex(ImGuiKey_LeftCtrl)) && !isSelected) {
|
||||
if (ImGui::IsKeyDown(ImGuiKey_LeftCtrl) && !isSelected) {
|
||||
mSelectedEntries.push_back(i);
|
||||
|
||||
} else {
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
|
||||
#include "window/gui/GuiWindow.h"
|
||||
#include "debug/Console.h"
|
||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#endif
|
||||
#include <imgui.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
#include <memory>
|
||||
|
||||
#include "debug/Console.h"
|
||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#endif
|
||||
#include <imgui.h>
|
||||
#include <unordered_map>
|
||||
#include "resource/ResourceManager.h"
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#endif
|
||||
|
||||
#include <imgui.h>
|
||||
#include <imgui_internal.h>
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#endif
|
||||
#include <imgui.h>
|
||||
#include <imgui_internal.h>
|
||||
#include "window/gui/GuiElement.h"
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
|
||||
#include "stdint.h"
|
||||
#include "window/gui/GuiWindow.h"
|
||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#endif
|
||||
#include <imgui.h>
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
#include "StatsWindow.h"
|
||||
#ifndef IMGUI_DEFINE_MATH_OPERATORS
|
||||
#define IMGUI_DEFINE_MATH_OPERATORS
|
||||
#endif
|
||||
#include <imgui.h>
|
||||
#include "public/bridge/consolevariablebridge.h"
|
||||
#include "spdlog/spdlog.h"
|
||||
|
||||
Reference in New Issue
Block a user