Skip to content

Commit 4fec0d0

Browse files
committed
Merge branch '2.6.x'
2 parents 98ab51b + bf46eaa commit 4fec0d0

File tree

2 files changed

+13
-43
lines changed

2 files changed

+13
-43
lines changed

Diff for: .github/workflows/ci.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ defaults:
1717

1818
jobs:
1919
build:
20-
name: ${{matrix.platform.name}} ${{matrix.config.name}} ${{matrix.type.name}}
20+
name: ${{matrix.platform.name}} ${{matrix.config.name}} ${{matrix.type.name}} ImGui ${{matrix.imgui.version}}
2121
runs-on: ${{matrix.platform.os}}
2222

2323
strategy:
@@ -36,6 +36,9 @@ jobs:
3636
type:
3737
- { name: Release }
3838
- { name: Debug }
39+
imgui:
40+
- { version: 1.89, flags: -DIMGUI_SFML_DISABLE_OBSOLETE_FUNCTIONS=ON }
41+
- { version: 1.91.5 }
3942

4043
steps:
4144
- name: Get CMake and Ninja
@@ -55,7 +58,7 @@ jobs:
5558
with:
5659
repository: ocornut/imgui
5760
path: imgui
58-
ref: v1.89
61+
ref: v${{matrix.imgui.version}}
5962

6063
- name: Checkout SFML
6164
uses: actions/checkout@v4
@@ -95,9 +98,9 @@ jobs:
9598
-DIMGUI_SFML_BUILD_EXAMPLES=ON \
9699
-DIMGUI_SFML_BUILD_TESTING=ON \
97100
-DIMGUI_SFML_ENABLE_WARNINGS=ON \
98-
-DIMGUI_SFML_DISABLE_OBSOLETE_FUNCTIONS=ON \
99101
${{matrix.platform.flags}} \
100-
${{matrix.config.flags}}
102+
${{matrix.config.flags}} \
103+
${{matrix.imgui.flags}}
101104
102105
- name: Build ImGui-SFML
103106
run: cmake --build imgui-sfml/build --config ${{matrix.type.name}} --target install

Diff for: imgui-SFML.cpp

+6-39
Original file line numberDiff line numberDiff line change
@@ -702,37 +702,10 @@ void SetJoystickRTriggerThreshold(float threshold)
702702
void SetJoystickMapping(int key, unsigned int joystickButton)
703703
{
704704
assert(s_currWindowCtx);
705-
// This function now expects ImGuiKey_* values.
706-
// For partial backwards compatibility, also expect some ImGuiNavInput_* values.
707-
ImGuiKey finalKey{};
708-
switch (key)
709-
{
710-
case ImGuiNavInput_Activate:
711-
finalKey = ImGuiKey_GamepadFaceDown;
712-
break;
713-
case ImGuiNavInput_Cancel:
714-
finalKey = ImGuiKey_GamepadFaceRight;
715-
break;
716-
case ImGuiNavInput_Input:
717-
finalKey = ImGuiKey_GamepadFaceUp;
718-
break;
719-
case ImGuiNavInput_Menu:
720-
finalKey = ImGuiKey_GamepadFaceLeft;
721-
break;
722-
case ImGuiNavInput_FocusPrev:
723-
case ImGuiNavInput_TweakSlow:
724-
finalKey = ImGuiKey_GamepadL1;
725-
break;
726-
case ImGuiNavInput_FocusNext:
727-
case ImGuiNavInput_TweakFast:
728-
finalKey = ImGuiKey_GamepadR1;
729-
break;
730-
default:
731-
assert(key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END);
732-
finalKey = static_cast<ImGuiKey>(key);
733-
}
705+
assert(key >= ImGuiKey_NamedKey_BEGIN);
706+
assert(key < ImGuiKey_NamedKey_END);
734707
assert(joystickButton < sf::Joystick::ButtonCount);
735-
s_currWindowCtx->joystickMapping[joystickButton] = finalKey;
708+
s_currWindowCtx->joystickMapping[joystickButton] = static_cast<ImGuiKey>(key);
736709
}
737710

738711
void SetDPadXAxis(sf::Joystick::Axis dPadXAxis, bool inverted)
@@ -1027,18 +1000,12 @@ void RenderDrawLists(ImDrawData* draw_data)
10271000
const ImDrawList* cmd_list = draw_data->CmdLists[n];
10281001
const ImDrawVert* vtx_buffer = cmd_list->VtxBuffer.Data;
10291002
const ImDrawIdx* idx_buffer = cmd_list->IdxBuffer.Data;
1030-
glVertexPointer(2,
1031-
GL_FLOAT,
1032-
sizeof(ImDrawVert),
1033-
(const GLvoid*)((const char*)vtx_buffer + IM_OFFSETOF(ImDrawVert, pos)));
1034-
glTexCoordPointer(2,
1035-
GL_FLOAT,
1036-
sizeof(ImDrawVert),
1037-
(const GLvoid*)((const char*)vtx_buffer + IM_OFFSETOF(ImDrawVert, uv)));
1003+
glVertexPointer(2, GL_FLOAT, sizeof(ImDrawVert), (const GLvoid*)((const char*)vtx_buffer + offsetof(ImDrawVert, pos)));
1004+
glTexCoordPointer(2, GL_FLOAT, sizeof(ImDrawVert), (const GLvoid*)((const char*)vtx_buffer + offsetof(ImDrawVert, uv)));
10381005
glColorPointer(4,
10391006
GL_UNSIGNED_BYTE,
10401007
sizeof(ImDrawVert),
1041-
(const GLvoid*)((const char*)vtx_buffer + IM_OFFSETOF(ImDrawVert, col)));
1008+
(const GLvoid*)((const char*)vtx_buffer + offsetof(ImDrawVert, col)));
10421009

10431010
for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++)
10441011
{

0 commit comments

Comments
 (0)