diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c9a646..c15e2c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,8 +37,8 @@ jobs: - { name: Release } - { name: Debug } imgui: - - { version: 1.89, flags: -DIMGUI_SFML_DISABLE_OBSOLETE_FUNCTIONS=ON } - - { version: 1.91.5 } + - { version: 1.91.1, flags: -DIMGUI_SFML_DISABLE_OBSOLETE_FUNCTIONS=ON } + - { version: 1.91.6 } steps: - name: Get CMake and Ninja diff --git a/CMakeLists.txt b/CMakeLists.txt index 51eec12..7945482 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,7 @@ if(NOT IMGUI_DIR) endif() # This uses FindImGui.cmake provided in ImGui-SFML repo for now -find_package(ImGui 1.89 REQUIRED) +find_package(ImGui 1.91.1 REQUIRED) # These headers will be installed alongside ImGui-SFML set(IMGUI_PUBLIC_HEADERS diff --git a/README.md b/README.md index 55d2857..027e6e0 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Dependencies ----- * [SFML](https://github.com/SFML/SFML) >= 3.0.0 -* [Dear ImGui](https://github.com/ocornut/imgui) >= 1.89 +* [Dear ImGui](https://github.com/ocornut/imgui) >= 1.91.1 Contributing ----- diff --git a/imgui-SFML.cpp b/imgui-SFML.cpp index 1ce54ea..e879d35 100644 --- a/imgui-SFML.cpp +++ b/imgui-SFML.cpp @@ -200,12 +200,12 @@ void updateJoystickDPadState(ImGuiIO& io); void updateJoystickAxisState(ImGuiIO& io); // clipboard functions -void setClipboardText(void* /*userData*/, const char* text) +void setClipboardText(ImGuiContext* /*ctx*/, const char* text) { sf::Clipboard::setString(sf::String::fromUtf8(text, text + std::strlen(text))); } -[[nodiscard]] const char* getClipboardText(void* /*userData*/) +[[nodiscard]] const char* getClipboardText(ImGuiContext* /*ctx*/) { static std::string s_clipboardText; @@ -306,7 +306,8 @@ bool Init(sf::Window& window, const sf::Vector2f& displaySize, bool loadDefaultF s_currWindowCtx = s_windowContexts.emplace_back(std::make_unique(&window)).get(); ImGui::SetCurrentContext(s_currWindowCtx->imContext); - ImGuiIO& io = ImGui::GetIO(); + ImGuiIO& io = ImGui::GetIO(); + ImGuiPlatformIO& platform_io = ImGui::GetPlatformIO(); // tell ImGui which features we support io.BackendFlags |= ImGuiBackendFlags_HasGamepad; @@ -322,8 +323,8 @@ bool Init(sf::Window& window, const sf::Vector2f& displaySize, bool loadDefaultF io.DisplaySize = toImVec2(displaySize); // clipboard - io.SetClipboardTextFn = setClipboardText; - io.GetClipboardTextFn = getClipboardText; + platform_io.Platform_SetClipboardTextFn = setClipboardText; + platform_io.Platform_GetClipboardTextFn = getClipboardText; // load mouse cursors const auto loadMouseCursor = [](ImGuiMouseCursor imguiCursorType, sf::Cursor::Type sfmlCursorType)