diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd686b8..a3a1d37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ defaults: jobs: build: - name: ${{matrix.platform.name}} ${{matrix.config.name}} ${{matrix.type.name}} + name: ${{matrix.platform.name}} ${{matrix.config.name}} ${{matrix.type.name}} ImGui ${{matrix.imgui.version}} runs-on: ${{matrix.platform.os}} strategy: @@ -36,6 +36,9 @@ jobs: type: - { name: Release } - { name: Debug } + imgui: + - { version: 1.89, flags: -DIMGUI_SFML_DISABLE_OBSOLETE_FUNCTIONS=ON } + - { version: 1.91.5 } steps: - name: Get CMake and Ninja @@ -55,7 +58,7 @@ jobs: with: repository: ocornut/imgui path: imgui - ref: v1.89 + ref: v${{matrix.imgui.version}} - name: Checkout SFML uses: actions/checkout@v4 @@ -95,9 +98,9 @@ jobs: -DIMGUI_SFML_BUILD_EXAMPLES=ON \ -DIMGUI_SFML_BUILD_TESTING=ON \ -DIMGUI_SFML_ENABLE_WARNINGS=ON \ - -DIMGUI_SFML_DISABLE_OBSOLETE_FUNCTIONS=ON \ ${{matrix.platform.flags}} \ - ${{matrix.config.flags}} + ${{matrix.config.flags}} \ + ${{matrix.imgui.flags}} - name: Build ImGui-SFML run: cmake --build imgui-sfml/build --config ${{matrix.type.name}} --target install diff --git a/imgui-SFML.cpp b/imgui-SFML.cpp index b78898a..1ce54ea 100644 --- a/imgui-SFML.cpp +++ b/imgui-SFML.cpp @@ -702,37 +702,10 @@ void SetJoystickRTriggerThreshold(float threshold) void SetJoystickMapping(int key, unsigned int joystickButton) { assert(s_currWindowCtx); - // This function now expects ImGuiKey_* values. - // For partial backwards compatibility, also expect some ImGuiNavInput_* values. - ImGuiKey finalKey{}; - switch (key) - { - case ImGuiNavInput_Activate: - finalKey = ImGuiKey_GamepadFaceDown; - break; - case ImGuiNavInput_Cancel: - finalKey = ImGuiKey_GamepadFaceRight; - break; - case ImGuiNavInput_Input: - finalKey = ImGuiKey_GamepadFaceUp; - break; - case ImGuiNavInput_Menu: - finalKey = ImGuiKey_GamepadFaceLeft; - break; - case ImGuiNavInput_FocusPrev: - case ImGuiNavInput_TweakSlow: - finalKey = ImGuiKey_GamepadL1; - break; - case ImGuiNavInput_FocusNext: - case ImGuiNavInput_TweakFast: - finalKey = ImGuiKey_GamepadR1; - break; - default: - assert(key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END); - finalKey = static_cast(key); - } + assert(key >= ImGuiKey_NamedKey_BEGIN); + assert(key < ImGuiKey_NamedKey_END); assert(joystickButton < sf::Joystick::ButtonCount); - s_currWindowCtx->joystickMapping[joystickButton] = finalKey; + s_currWindowCtx->joystickMapping[joystickButton] = static_cast(key); } void SetDPadXAxis(sf::Joystick::Axis dPadXAxis, bool inverted) @@ -1027,18 +1000,12 @@ void RenderDrawLists(ImDrawData* draw_data) const ImDrawList* cmd_list = draw_data->CmdLists[n]; const ImDrawVert* vtx_buffer = cmd_list->VtxBuffer.Data; const ImDrawIdx* idx_buffer = cmd_list->IdxBuffer.Data; - glVertexPointer(2, - GL_FLOAT, - sizeof(ImDrawVert), - (const GLvoid*)((const char*)vtx_buffer + IM_OFFSETOF(ImDrawVert, pos))); - glTexCoordPointer(2, - GL_FLOAT, - sizeof(ImDrawVert), - (const GLvoid*)((const char*)vtx_buffer + IM_OFFSETOF(ImDrawVert, uv))); + glVertexPointer(2, GL_FLOAT, sizeof(ImDrawVert), (const GLvoid*)((const char*)vtx_buffer + offsetof(ImDrawVert, pos))); + glTexCoordPointer(2, GL_FLOAT, sizeof(ImDrawVert), (const GLvoid*)((const char*)vtx_buffer + offsetof(ImDrawVert, uv))); glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(ImDrawVert), - (const GLvoid*)((const char*)vtx_buffer + IM_OFFSETOF(ImDrawVert, col))); + (const GLvoid*)((const char*)vtx_buffer + offsetof(ImDrawVert, col))); for (int cmd_i = 0; cmd_i < cmd_list->CmdBuffer.Size; cmd_i++) {