Skip to content

Commit e54da70

Browse files
committed
Merge branch '2.6.x'
2 parents cdf8a7e + 188d5d1 commit e54da70

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- { name: Windows ClangCL, os: windows-2022, flags: -T ClangCL }
2929
- { name: Windows Clang, os: windows-2022, flags: -GNinja -DCMAKE_CXX_COMPILER=clang++ }
3030
- { name: Linux GCC, os: ubuntu-22.04, flags: -GNinja }
31-
- { name: Linux Clang, os: ubuntu-22.04, flags: -GNinja -DCMAKE_CXX_COMPILER=clang++ }
31+
- { name: Linux Clang, os: ubuntu-22.04, flags: -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ }
3232
- { name: macOS Clang, os: macos-13, flags: -GNinja -DIMGUI_SFML_BUILD_TESTING=OFF }
3333
config:
3434
- { name: Shared, flags: -DBUILD_SHARED_LIBS=ON -DIMGUI_SFML_BUILD_TESTING=OFF }
@@ -95,6 +95,7 @@ jobs:
9595
-DIMGUI_SFML_BUILD_EXAMPLES=ON \
9696
-DIMGUI_SFML_BUILD_TESTING=ON \
9797
-DIMGUI_SFML_ENABLE_WARNINGS=ON \
98+
-DIMGUI_SFML_DISABLE_OBSOLETE_FUNCTIONS=ON \
9899
${{matrix.platform.flags}} \
99100
${{matrix.config.flags}}
100101

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ project(imgui_sfml VERSION 3.0.0 LANGUAGES CXX)
33

44
option(IMGUI_SFML_FIND_SFML "Use find_package to find SFML" ON)
55
option(IMGUI_SFML_ENABLE_WARNINGS "Enable compiler warnings" OFF)
6+
option(IMGUI_SFML_DISABLE_OBSOLETE_FUNCTIONS "Disable obsolete ImGui functions" OFF)
67

78
# If you want to use your own user config when compiling ImGui, please set the following variables
89
# For example, if you have your config in /path/to/dir/with/config/myconfig.h, set the variables as follows:
@@ -78,6 +79,9 @@ if(BUILD_SHARED_LIBS)
7879
set_target_properties(ImGui-SFML PROPERTIES DEFINE_SYMBOL "IMGUI_SFML_EXPORTS")
7980
set_target_properties(ImGui-SFML PROPERTIES DEBUG_POSTFIX "_d")
8081
endif()
82+
if(IMGUI_SFML_DISABLE_OBSOLETE_FUNCTIONS)
83+
target_compile_definitions(ImGui-SFML PUBLIC IMGUI_DISABLE_OBSOLETE_FUNCTIONS)
84+
endif()
8185

8286
# Add compiler warnings
8387
if(IMGUI_SFML_ENABLE_WARNINGS)

imgui-SFML.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -425,10 +425,10 @@ void ProcessEvent(const sf::Window& window, const sf::Event& event)
425425
}
426426
else
427427
{
428-
io.AddKeyEvent(ImGuiKey_ModCtrl, keyChanged.control);
429-
io.AddKeyEvent(ImGuiKey_ModShift, keyChanged.shift);
430-
io.AddKeyEvent(ImGuiKey_ModAlt, keyChanged.alt);
431-
io.AddKeyEvent(ImGuiKey_ModSuper, keyChanged.system);
428+
io.AddKeyEvent(ImGuiMod_Ctrl, keyChanged.control);
429+
io.AddKeyEvent(ImGuiMod_Shift, keyChanged.shift);
430+
io.AddKeyEvent(ImGuiMod_Alt, keyChanged.alt);
431+
io.AddKeyEvent(ImGuiMod_Super, keyChanged.system);
432432
}
433433

434434
const ImGuiKey key = keycodeToImGuiKey(keyChanged.code);
@@ -1481,16 +1481,16 @@ ImGuiKey keycodeToImGuiMod(sf::Keyboard::Key code)
14811481
{
14821482
case sf::Keyboard::Key::LControl:
14831483
case sf::Keyboard::Key::RControl:
1484-
return ImGuiKey_ModCtrl;
1484+
return ImGuiMod_Ctrl;
14851485
case sf::Keyboard::Key::LShift:
14861486
case sf::Keyboard::Key::RShift:
1487-
return ImGuiKey_ModShift;
1487+
return ImGuiMod_Shift;
14881488
case sf::Keyboard::Key::LAlt:
14891489
case sf::Keyboard::Key::RAlt:
1490-
return ImGuiKey_ModAlt;
1490+
return ImGuiMod_Alt;
14911491
case sf::Keyboard::Key::LSystem:
14921492
case sf::Keyboard::Key::RSystem:
1493-
return ImGuiKey_ModSuper;
1493+
return ImGuiMod_Super;
14941494
default:
14951495
break;
14961496
}

0 commit comments

Comments
 (0)