diff --git a/src/Application/Application.cpp b/src/Application/Application.cpp index ecade15..3bb9f24 100644 --- a/src/Application/Application.cpp +++ b/src/Application/Application.cpp @@ -191,23 +191,23 @@ Application::keyReleaseEvent(KeyEvent& event) { } void -Application::mousePressEvent(MouseEvent& event) { - if(_imgui.handleMousePressEvent(event)) return; +Application::pointerPressEvent(PointerEvent& event) { + if(_imgui.handlePointerPressEvent(event)) return; } void -Application::mouseReleaseEvent(MouseEvent& event) { - if(_imgui.handleMouseReleaseEvent(event)) return; +Application::pointerReleaseEvent(PointerEvent& event) { + if(_imgui.handlePointerReleaseEvent(event)) return; } void -Application::mouseMoveEvent(MouseMoveEvent& event) { - if(_imgui.handleMouseMoveEvent(event)) return; +Application::pointerMoveEvent(PointerMoveEvent& event) { + if(_imgui.handlePointerMoveEvent(event)) return; } void -Application::mouseScrollEvent(MouseScrollEvent& event) { - if(_imgui.handleMouseScrollEvent(event)) { +Application::scrollEvent(ScrollEvent& event) { + if(_imgui.handleScrollEvent(event)) { event.setAccepted(); return; } diff --git a/src/Application/Application.h b/src/Application/Application.h index ba7c9e4..45f5834 100644 --- a/src/Application/Application.h +++ b/src/Application/Application.h @@ -74,10 +74,10 @@ class Application: public Platform::Sdl2Application, public efsw::FileWatchListe void keyPressEvent(KeyEvent& event) override; void keyReleaseEvent(KeyEvent& event) override; - void mousePressEvent(MouseEvent& event) override; - void mouseReleaseEvent(MouseEvent& event) override; - void mouseMoveEvent(MouseMoveEvent& event) override; - void mouseScrollEvent(MouseScrollEvent& event) override; + void pointerPressEvent(PointerEvent& event) override; + void pointerReleaseEvent(PointerEvent& event) override; + void pointerMoveEvent(PointerMoveEvent& event) override; + void scrollEvent(ScrollEvent& event) override; void textInputEvent(TextInputEvent& event) override; void anyEvent(SDL_Event& event) override; diff --git a/src/Application/Application_Initialisation.cpp b/src/Application/Application_Initialisation.cpp index 90dab3f..d7500e1 100644 --- a/src/Application/Application_Initialisation.cpp +++ b/src/Application/Application_Initialisation.cpp @@ -16,6 +16,8 @@ #include +#include + #include #include @@ -52,7 +54,8 @@ Application::initialiseConfiguration() { LOG_INFO("Reading configuration file."); setSwapInterval(conf().swapInterval()); - setMinimalLoopPeriod(0); + using namespace Math::Literals; + setMinimalLoopPeriod(0_nsec); } void diff --git a/src/Application/Application_drawMainMenu.cpp b/src/Application/Application_drawMainMenu.cpp index bd14870..98e5672 100644 --- a/src/Application/Application_drawMainMenu.cpp +++ b/src/Application/Application_drawMainMenu.cpp @@ -16,6 +16,8 @@ #include +#include + #include "../Configuration/Configuration.h" #include "../FontAwesome/IconsFontAwesome5.h" #include "../FontAwesome/IconsFontAwesome5Brands.h" @@ -98,7 +100,8 @@ Application::drawMainMenu() { conf().setSwapInterval(i); setSwapInterval(i); if(i == 0) { - setMinimalLoopPeriod(0); + using namespace Math::Literals; + setMinimalLoopPeriod(0_nsec); } } }