Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions ci/warning-suppresions.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
# Suppress warnings in external code from submodules

[nontrivial-memcall]
src:*/modules/imgui/*

[deprecated-literal-operator]
src:*/modules/corrade/*
src:*/modules/magnum/*
2 changes: 1 addition & 1 deletion modules/corrade
Submodule corrade updated 546 files
2 changes: 1 addition & 1 deletion modules/imgui
Submodule imgui updated 149 files
2 changes: 1 addition & 1 deletion modules/magnum
Submodule magnum updated 1508 files
2 changes: 1 addition & 1 deletion modules/magnum-integration
2 changes: 1 addition & 1 deletion modules/magnum-plugins
Submodule magnum-plugins updated 632 files
4 changes: 2 additions & 2 deletions src/fluid/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())};
Expand Down
4 changes: 3 additions & 1 deletion src/game_of_life/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
11 changes: 6 additions & 5 deletions src/game_of_life/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/mandelbrot/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
11 changes: 6 additions & 5 deletions src/mandelbrot/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand All @@ -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;
Expand Down
16 changes: 8 additions & 8 deletions src/nbody/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading