Skip to content

Commit bcc0d80

Browse files
committed
Update visual sample dependencies
The samples us some third-party libraries which have moved on since these were ported to Magnum. Especially compatibility with CMake 4 and newer; in addition some warnings have been fixed in third-party headers. On the other hand the APIs have had some updates, so the code has been updated to dodge some new deprecations.
1 parent 73bdd25 commit bcc0d80

File tree

13 files changed

+30
-35
lines changed

13 files changed

+30
-35
lines changed

ci/warning-suppresions.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
11
# Suppress warnings in external code from submodules
2-
3-
[nontrivial-memcall]
4-
src:*/modules/imgui/*
5-
6-
[deprecated-literal-operator]
7-
src:*/modules/corrade/*
8-
src:*/modules/magnum/*

modules/corrade

Submodule corrade updated 546 files

modules/imgui

Submodule imgui updated 149 files

modules/magnum

Submodule magnum updated 1508 files

modules/magnum-integration

Submodule magnum-integration updated 149 files

modules/magnum-plugins

Submodule magnum-plugins updated 632 files

src/fluid/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,12 @@ class FluidSimulationApp : public Magnum::Platform::Application {
118118
private:
119119
void keyPressEvent(KeyEvent& event) override final {
120120
// Reset fluid container to empty if SPACE key is pressed.
121-
if (event.key() == KeyEvent::Key::Space) {
121+
if (event.key() == Sdl2Application::Key::Space) {
122122
fluid_.Reset();
123123
}
124124
}
125125

126-
void mouseMoveEvent(MouseMoveEvent& event) override final {
126+
void pointerMoveEvent(PointerMoveEvent& event) override final {
127127
// Get mouse position as fraction of window size.
128128
auto x{event.position().x() / float(windowSize().x())};
129129
auto y{1.0f - event.position().y() / float(windowSize().y())};

src/game_of_life/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ target_link_libraries(GameOfLife PRIVATE
55
Magnum::Magnum Magnum::GL Magnum::Application
66
Magnum::Shaders Magnum::Primitives)
77

8-
target_compile_options(GameOfLife PUBLIC ${SYCL_FLAGS})
8+
target_compile_options(GameOfLife PUBLIC ${SYCL_FLAGS} -Wno-c++20-extensions)
99
target_link_options(GameOfLife PUBLIC ${SYCL_FLAGS})

src/game_of_life/main.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,18 +166,19 @@ class GameOfLifeApp : public Magnum::Platform::Application {
166166
}
167167
}
168168

169-
void mousePressEvent(MouseEvent& event) override {
169+
void pointerPressEvent(PointerEvent& event) override {
170170
handleMouse(event.position().x(), event.position().y());
171171
}
172172

173-
void mouseMoveEvent(MouseMoveEvent& event) override {
173+
void pointerMoveEvent(PointerMoveEvent& event) override {
174174
// Drag only if left button clicked
175-
if ((event.buttons() & MouseMoveEvent::Button::Left)) {
175+
using enum Magnum::Platform::Sdl2Application::Pointer;
176+
if ((event.pointers() & MouseLeft)) {
176177
handleMouse(event.position().x(), event.position().y());
177178
}
178179
}
179180

180-
void mouseScrollEvent(MouseScrollEvent& event) override {
181+
void scrollEvent(ScrollEvent& event) override {
181182
auto prevZoom = m_zoom;
182183
auto inc = event.offset().y();
183184
if (inc > 0) {
@@ -198,7 +199,7 @@ class GameOfLifeApp : public Magnum::Platform::Application {
198199

199200
void keyPressEvent(KeyEvent& event) override {
200201
// (Un)pause on SPACE
201-
if (event.key() == KeyEvent::Key::Space) {
202+
if (event.key() == Sdl2Application::Key::Space) {
202203
m_paused = !m_paused;
203204
}
204205
}

0 commit comments

Comments
 (0)