summaryrefslogtreecommitdiffhomepage
path: root/main/events.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-23 17:31:31 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-23 17:31:31 +0200
commitcce1f768e7399b838a2b865511915bdd576dbbf4 (patch)
tree4c6a8f2dc9112394fd329d56c0f628ce66b16467 /main/events.cpp
parent6b875a0919b9932eca9ed877552c34ecb220b7d8 (diff)
a
Diffstat (limited to 'main/events.cpp')
-rw-r--r--main/events.cpp35
1 files changed, 12 insertions, 23 deletions
diff --git a/main/events.cpp b/main/events.cpp
index 83362bfe..989406ba 100644
--- a/main/events.cpp
+++ b/main/events.cpp
@@ -1,20 +1,18 @@
#pragma once
-#include "app.hpp"
-#include <Magnum/ImGuiIntegration/Context.hpp>
-
+#include "floormat-main.hpp"
#include <cstdio>
#include <SDL_events.h>
#include <SDL_video.h>
namespace floormat {
-void app::viewportEvent(Platform::Sdl2Application::ViewportEvent& event)
+void main_impl::viewportEvent(Platform::Sdl2Application::ViewportEvent& event)
{
fm_assert(event.framebufferSize() == event.windowSize());
recalc_viewport(event.windowSize());
}
-void app::mousePressEvent(Platform::Sdl2Application::MouseEvent& event)
+void main_impl::mousePressEvent(Platform::Sdl2Application::MouseEvent& event)
{
if (_imgui.handleMousePressEvent(event))
return event.setAccepted();
@@ -25,14 +23,14 @@ void app::mousePressEvent(Platform::Sdl2Application::MouseEvent& event)
}
}
-void app::mouseReleaseEvent(Platform::Sdl2Application::MouseEvent& event)
+void main_impl::mouseReleaseEvent(Platform::Sdl2Application::MouseEvent& event)
{
if (_imgui.handleMouseReleaseEvent(event))
return event.setAccepted();
do_mouse_release((int)event.button());
}
-void app::mouseMoveEvent(Platform::Sdl2Application::MouseMoveEvent& event)
+void main_impl::mouseMoveEvent(Platform::Sdl2Application::MouseMoveEvent& event)
{
_cursor_in_imgui = _imgui.handleMouseMoveEvent(event);
if (_cursor_in_imgui)
@@ -44,13 +42,13 @@ void app::mouseMoveEvent(Platform::Sdl2Application::MouseMoveEvent& event)
do_mouse_move(*_cursor_tile);
}
-void app::mouseScrollEvent(Platform::Sdl2Application::MouseScrollEvent& event)
+void main_impl::mouseScrollEvent(Platform::Sdl2Application::MouseScrollEvent& event)
{
if (_imgui.handleMouseScrollEvent(event))
return event.setAccepted();
}
-void app::textInputEvent(Platform::Sdl2Application::TextInputEvent& event)
+void main_impl::textInputEvent(Platform::Sdl2Application::TextInputEvent& event)
{
if (_imgui.handleTextInputEvent(event))
{
@@ -59,7 +57,7 @@ void app::textInputEvent(Platform::Sdl2Application::TextInputEvent& event)
}
}
-void app::keyPressEvent(Platform::Sdl2Application::KeyEvent& event)
+void main_impl::keyPressEvent(Platform::Sdl2Application::KeyEvent& event)
{
if (_imgui.handleKeyPressEvent(event))
{
@@ -69,7 +67,7 @@ void app::keyPressEvent(Platform::Sdl2Application::KeyEvent& event)
do_key(event.key(), event.modifiers(), true, event.isRepeated());
}
-void app::keyReleaseEvent(Platform::Sdl2Application::KeyEvent& event)
+void main_impl::keyReleaseEvent(Platform::Sdl2Application::KeyEvent& event)
{
if (_imgui.handleKeyReleaseEvent(event))
{
@@ -79,7 +77,7 @@ void app::keyReleaseEvent(Platform::Sdl2Application::KeyEvent& event)
do_key(event.key(), event.modifiers(), false, false);
}
-void app::anyEvent(SDL_Event& event)
+void main_impl::anyEvent(SDL_Event& event)
{
if (event.type == SDL_WINDOWEVENT)
switch (event.window.event)
@@ -97,25 +95,16 @@ void app::anyEvent(SDL_Event& event)
}
}
-void app::event_focus_out()
+void main_impl::event_focus_out() // TODO move to app
{
_cursor_pixel = std::nullopt;
recalc_cursor_tile();
}
-void app::event_focus_in()
-{
-}
-
-void app::event_mouse_leave()
+void main_impl::event_mouse_leave() // TODO move to app
{
_cursor_pixel = std::nullopt;
recalc_cursor_tile();
}
-void app::event_mouse_enter()
-{
-}
-
-
} // namespace floormat