From cd6cc99f228da931cb2849d19957e3cce0a1d3c8 Mon Sep 17 00:00:00 2001 From: Vittorio Romeo Date: Thu, 9 Dec 2021 01:00:38 +0000 Subject: [PATCH 1/3] Do not use deprecated 'sf::Keyboard::Key' enumerator --- imgui-SFML.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui-SFML.cpp b/imgui-SFML.cpp index 6ca64ae..fda7a5b 100644 --- a/imgui-SFML.cpp +++ b/imgui-SFML.cpp @@ -279,9 +279,9 @@ void Init(sf::Window& window, const sf::Vector2f& displaySize, bool loadDefaultF io.KeyMap[ImGuiKey_End] = sf::Keyboard::End; io.KeyMap[ImGuiKey_Insert] = sf::Keyboard::Insert; io.KeyMap[ImGuiKey_Delete] = sf::Keyboard::Delete; - io.KeyMap[ImGuiKey_Backspace] = sf::Keyboard::BackSpace; + io.KeyMap[ImGuiKey_Backspace] = sf::Keyboard::Backspace; io.KeyMap[ImGuiKey_Space] = sf::Keyboard::Space; - io.KeyMap[ImGuiKey_Enter] = sf::Keyboard::Return; + io.KeyMap[ImGuiKey_Enter] = sf::Keyboard::Enter; io.KeyMap[ImGuiKey_Escape] = sf::Keyboard::Escape; io.KeyMap[ImGuiKey_A] = sf::Keyboard::A; io.KeyMap[ImGuiKey_C] = sf::Keyboard::C; From 9043fd76fd73874a0e4d0853e9eddf4a133c5b2a Mon Sep 17 00:00:00 2001 From: Vittorio Romeo Date: Thu, 9 Dec 2021 01:03:51 +0000 Subject: [PATCH 2/3] Suppress "unused variable" warning in RELEASE mode for 'ctxFound' --- imgui-SFML.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/imgui-SFML.cpp b/imgui-SFML.cpp index fda7a5b..7f5042f 100644 --- a/imgui-SFML.cpp +++ b/imgui-SFML.cpp @@ -557,6 +557,7 @@ void Shutdown(const sf::Window& window) { break; } } + (void) ctxFound; // prevent warning in RELEASE mode assert(ctxFound && "Window wasn't inited properly: forgot to call ImGui::SFML::Init(window)?"); s_windowContexts.erase(s_windowContexts.begin() + ctxIdxToErase); } From 887c1703cbf6fe7f5cfe98fcb3e7262d03a663bf Mon Sep 17 00:00:00 2001 From: Vittorio Romeo Date: Thu, 9 Dec 2021 01:22:56 +0000 Subject: [PATCH 3/3] Fix formatting --- imgui-SFML.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui-SFML.cpp b/imgui-SFML.cpp index 7f5042f..5ef1556 100644 --- a/imgui-SFML.cpp +++ b/imgui-SFML.cpp @@ -557,7 +557,7 @@ void Shutdown(const sf::Window& window) { break; } } - (void) ctxFound; // prevent warning in RELEASE mode + (void)ctxFound; // prevent warning in RELEASE mode assert(ctxFound && "Window wasn't inited properly: forgot to call ImGui::SFML::Init(window)?"); s_windowContexts.erase(s_windowContexts.begin() + ctxIdxToErase); }