diff --git a/ci/warning-suppresions.txt b/ci/warning-suppresions.txt index 34d3acc..212ebb9 100644 --- a/ci/warning-suppresions.txt +++ b/ci/warning-suppresions.txt @@ -1,8 +1 @@ # Suppress warnings in external code from submodules - -[nontrivial-memcall] -src:*/modules/imgui/* - -[deprecated-literal-operator] -src:*/modules/corrade/* -src:*/modules/magnum/* diff --git a/modules/corrade b/modules/corrade index dc51b04..8b3c022 160000 --- a/modules/corrade +++ b/modules/corrade @@ -1 +1 @@ -Subproject commit dc51b04b86294b00db45156e5e6cfdb1a6462df9 +Subproject commit 8b3c02277020d9c609f54200d050ff665c4431e1 diff --git a/modules/imgui b/modules/imgui index c6e0284..f5befd2 160000 --- a/modules/imgui +++ b/modules/imgui @@ -1 +1 @@ -Subproject commit c6e0284ac58b3f205c95365478888f7b53b077e2 +Subproject commit f5befd2d29e66809cd1110a152e375a7f1981f06 diff --git a/modules/magnum b/modules/magnum index d0b7927..be38d5e 160000 --- a/modules/magnum +++ b/modules/magnum @@ -1 +1 @@ -Subproject commit d0b792791fa707861947e600f5b119d2a1ecb9db +Subproject commit be38d5e2bbd03cab4f31707d8a012a4ce119fc40 diff --git a/modules/magnum-bootstrap b/modules/magnum-bootstrap index 2d89739..2798308 160000 --- a/modules/magnum-bootstrap +++ b/modules/magnum-bootstrap @@ -1 +1 @@ -Subproject commit 2d897393d51e0c8325b9d9f6e49a99317a355ca5 +Subproject commit 2798308125760a88c13556ab15c9b20a7b78abb5 diff --git a/modules/magnum-integration b/modules/magnum-integration index bb8a4a8..30d179f 160000 --- a/modules/magnum-integration +++ b/modules/magnum-integration @@ -1 +1 @@ -Subproject commit bb8a4a870f217fc9ac15ff0ddc145974be49a5e7 +Subproject commit 30d179f341eafb2b69d9c29d9b7af2b736122786 diff --git a/modules/magnum-plugins b/modules/magnum-plugins index 150d1a5..9f31cf5 160000 --- a/modules/magnum-plugins +++ b/modules/magnum-plugins @@ -1 +1 @@ -Subproject commit 150d1a5f1f6d6e308595204393103a3e773e078e +Subproject commit 9f31cf5a0a6a44a63e320924141513d473586760 diff --git a/src/fluid/main.cpp b/src/fluid/main.cpp index fdccf30..c1c8db1 100644 --- a/src/fluid/main.cpp +++ b/src/fluid/main.cpp @@ -118,12 +118,12 @@ class FluidSimulationApp : public Magnum::Platform::Application { private: void keyPressEvent(KeyEvent& event) override final { // Reset fluid container to empty if SPACE key is pressed. - if (event.key() == KeyEvent::Key::Space) { + if (event.key() == Sdl2Application::Key::Space) { fluid_.Reset(); } } - void mouseMoveEvent(MouseMoveEvent& event) override final { + void pointerMoveEvent(PointerMoveEvent& event) override final { // Get mouse position as fraction of window size. auto x{event.position().x() / float(windowSize().x())}; auto y{1.0f - event.position().y() / float(windowSize().y())}; diff --git a/src/game_of_life/CMakeLists.txt b/src/game_of_life/CMakeLists.txt index 5af2b30..c9f82ef 100644 --- a/src/game_of_life/CMakeLists.txt +++ b/src/game_of_life/CMakeLists.txt @@ -5,5 +5,7 @@ target_link_libraries(GameOfLife PRIVATE Magnum::Magnum Magnum::GL Magnum::Application Magnum::Shaders Magnum::Primitives) -target_compile_options(GameOfLife PUBLIC ${SYCL_FLAGS}) +# `using enum` is apparently a C++ 20 extension, but is widely supported, +# so we can use it without a feature test (and this skips the warning). +target_compile_options(GameOfLife PUBLIC ${SYCL_FLAGS} -Wno-c++20-extensions) target_link_options(GameOfLife PUBLIC ${SYCL_FLAGS}) diff --git a/src/game_of_life/main.cpp b/src/game_of_life/main.cpp index d2393f7..233d9a8 100644 --- a/src/game_of_life/main.cpp +++ b/src/game_of_life/main.cpp @@ -166,18 +166,19 @@ class GameOfLifeApp : public Magnum::Platform::Application { } } - void mousePressEvent(MouseEvent& event) override { + void pointerPressEvent(PointerEvent& event) override { handleMouse(event.position().x(), event.position().y()); } - void mouseMoveEvent(MouseMoveEvent& event) override { + void pointerMoveEvent(PointerMoveEvent& event) override { // Drag only if left button clicked - if ((event.buttons() & MouseMoveEvent::Button::Left)) { + using enum Magnum::Platform::Sdl2Application::Pointer; + if ((event.pointers() & MouseLeft)) { handleMouse(event.position().x(), event.position().y()); } } - void mouseScrollEvent(MouseScrollEvent& event) override { + void scrollEvent(ScrollEvent& event) override { auto prevZoom = m_zoom; auto inc = event.offset().y(); if (inc > 0) { @@ -198,7 +199,7 @@ class GameOfLifeApp : public Magnum::Platform::Application { void keyPressEvent(KeyEvent& event) override { // (Un)pause on SPACE - if (event.key() == KeyEvent::Key::Space) { + if (event.key() == Sdl2Application::Key::Space) { m_paused = !m_paused; } } diff --git a/src/mandelbrot/CMakeLists.txt b/src/mandelbrot/CMakeLists.txt index eb5e8ee..a612315 100644 --- a/src/mandelbrot/CMakeLists.txt +++ b/src/mandelbrot/CMakeLists.txt @@ -6,5 +6,7 @@ target_link_libraries(Mandelbrot PRIVATE Magnum::Magnum Magnum::GL Magnum::Application Magnum::Shaders Magnum::Primitives) -target_compile_options(Mandelbrot PUBLIC ${SYCL_FLAGS}) +# `using enum` is apparently a C++ 20 extension, but is widely supported, +# so we can use it without a feature test (and this skips the warning). +target_compile_options(Mandelbrot PUBLIC ${SYCL_FLAGS} -Wno-c++20-extensions) target_link_options(Mandelbrot PUBLIC ${SYCL_FLAGS}) diff --git a/src/mandelbrot/main.cpp b/src/mandelbrot/main.cpp index 9531df6..56a62ba 100644 --- a/src/mandelbrot/main.cpp +++ b/src/mandelbrot/main.cpp @@ -121,7 +121,7 @@ class MandelbrotApp : public Magnum::Platform::Application { swapBuffers(); } - void mouseScrollEvent(MouseScrollEvent& event) override { + void scrollEvent(ScrollEvent& event) override { // Zoom in or out on the plane auto inc = event.offset().y(); if (inc > 0) { @@ -131,9 +131,10 @@ class MandelbrotApp : public Magnum::Platform::Application { } } - void mouseMoveEvent(MouseMoveEvent& event) override { + void pointerMoveEvent(PointerMoveEvent& event) override { // Drag only if left button clicked - if (!(event.buttons() & MouseMoveEvent::Button::Left)) { + using enum Magnum::Platform::Sdl2Application::Pointer; + if (!(event.pointers() & Pointer::MouseLeft)) { return; } // Calculate normalized coordinates @@ -148,12 +149,12 @@ class MandelbrotApp : public Magnum::Platform::Application { // If the difference is big enough, drag the center point // and with it the viewable part of the plane. The epsilon // is necessary to avoid noisy jumps - constexpr double EPS = .1; + constexpr auto EPS = .1; if (dx < EPS && dx > -EPS) { m_ctr_x += dx * m_range; } if (dy < EPS && dy > -EPS) { - m_ctr_y += dy * m_range * double(WIDTH) / double(HEIGHT); + m_ctr_y += dy * m_range * WIDTH / HEIGHT; } m_prev_mx = x; diff --git a/src/nbody/main.cpp b/src/nbody/main.cpp index f87a4b9..bae37cf 100644 --- a/src/nbody/main.cpp +++ b/src/nbody/main.cpp @@ -572,17 +572,17 @@ class NBodyApp : public Magnum::Platform::Application { m_imgui.handleKeyReleaseEvent(event); } - void mousePressEvent(MouseEvent& event) override { - m_imgui.handleMousePressEvent(event); + void pointerPressEvent(PointerEvent& event) override { + m_imgui.handlePointerPressEvent(event); } - void mouseReleaseEvent(MouseEvent& event) override { - m_imgui.handleMouseReleaseEvent(event); + void pointerReleaseEvent(PointerEvent& event) override { + m_imgui.handlePointerReleaseEvent(event); } - void mouseMoveEvent(MouseMoveEvent& event) override { - m_imgui.handleMouseMoveEvent(event); + void pointerMoveEvent(PointerMoveEvent& event) override { + m_imgui.handlePointerMoveEvent(event); } - void mouseScrollEvent(MouseScrollEvent& event) override { - if (m_imgui.handleMouseScrollEvent(event)) { + void scrollEvent(ScrollEvent& event) override { + if (m_imgui.handleScrollEvent(event)) { /* Prevent scrolling the page */ event.setAccepted(); return;