Application: adapt to Magnum changes.

This commit is contained in:
Guillaume Jacquemin 2024-12-12 15:36:38 +01:00
parent f77fde3aff
commit 7540f9c152
Signed by: williamjcm
SSH key fingerprint: SHA256:AYLOg+iTV0ElElnlu4vqM4edFazVdRiuQB0Y5LoKc4A
4 changed files with 20 additions and 14 deletions

View file

@ -191,23 +191,23 @@ Application::keyReleaseEvent(KeyEvent& event) {
} }
void void
Application::mousePressEvent(MouseEvent& event) { Application::pointerPressEvent(PointerEvent& event) {
if(_imgui.handleMousePressEvent(event)) return; if(_imgui.handlePointerPressEvent(event)) return;
} }
void void
Application::mouseReleaseEvent(MouseEvent& event) { Application::pointerReleaseEvent(PointerEvent& event) {
if(_imgui.handleMouseReleaseEvent(event)) return; if(_imgui.handlePointerReleaseEvent(event)) return;
} }
void void
Application::mouseMoveEvent(MouseMoveEvent& event) { Application::pointerMoveEvent(PointerMoveEvent& event) {
if(_imgui.handleMouseMoveEvent(event)) return; if(_imgui.handlePointerMoveEvent(event)) return;
} }
void void
Application::mouseScrollEvent(MouseScrollEvent& event) { Application::scrollEvent(ScrollEvent& event) {
if(_imgui.handleMouseScrollEvent(event)) { if(_imgui.handleScrollEvent(event)) {
event.setAccepted(); event.setAccepted();
return; return;
} }

View file

@ -74,10 +74,10 @@ class Application: public Platform::Sdl2Application, public efsw::FileWatchListe
void keyPressEvent(KeyEvent& event) override; void keyPressEvent(KeyEvent& event) override;
void keyReleaseEvent(KeyEvent& event) override; void keyReleaseEvent(KeyEvent& event) override;
void mousePressEvent(MouseEvent& event) override; void pointerPressEvent(PointerEvent& event) override;
void mouseReleaseEvent(MouseEvent& event) override; void pointerReleaseEvent(PointerEvent& event) override;
void mouseMoveEvent(MouseMoveEvent& event) override; void pointerMoveEvent(PointerMoveEvent& event) override;
void mouseScrollEvent(MouseScrollEvent& event) override; void scrollEvent(ScrollEvent& event) override;
void textInputEvent(TextInputEvent& event) override; void textInputEvent(TextInputEvent& event) override;
void anyEvent(SDL_Event& event) override; void anyEvent(SDL_Event& event) override;

View file

@ -16,6 +16,8 @@
#include <cstring> #include <cstring>
#include <Magnum/Math/Time.h>
#include <SDL_events.h> #include <SDL_events.h>
#include <SDL_messagebox.h> #include <SDL_messagebox.h>
@ -52,7 +54,8 @@ Application::initialiseConfiguration() {
LOG_INFO("Reading configuration file."); LOG_INFO("Reading configuration file.");
setSwapInterval(conf().swapInterval()); setSwapInterval(conf().swapInterval());
setMinimalLoopPeriod(0); using namespace Math::Literals;
setMinimalLoopPeriod(0_nsec);
} }
void void

View file

@ -16,6 +16,8 @@
#include <Corrade/Utility/Path.h> #include <Corrade/Utility/Path.h>
#include <Magnum/Math/Time.h>
#include "../Configuration/Configuration.h" #include "../Configuration/Configuration.h"
#include "../FontAwesome/IconsFontAwesome5.h" #include "../FontAwesome/IconsFontAwesome5.h"
#include "../FontAwesome/IconsFontAwesome5Brands.h" #include "../FontAwesome/IconsFontAwesome5Brands.h"
@ -98,7 +100,8 @@ Application::drawMainMenu() {
conf().setSwapInterval(i); conf().setSwapInterval(i);
setSwapInterval(i); setSwapInterval(i);
if(i == 0) { if(i == 0) {
setMinimalLoopPeriod(0); using namespace Math::Literals;
setMinimalLoopPeriod(0_nsec);
} }
} }
} }