Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down
11 changes: 6 additions & 5 deletions imgui-SFML.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -306,7 +306,8 @@ bool Init(sf::Window& window, const sf::Vector2f& displaySize, bool loadDefaultF
s_currWindowCtx = s_windowContexts.emplace_back(std::make_unique<WindowContext>(&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;
Expand All @@ -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)
Expand Down