diff options
| author | vimene <vincent.menegaux@gmail.com> | 2025-12-10 20:40:42 +0100 |
|---|---|---|
| committer | vimene <vincent.menegaux@gmail.com> | 2025-12-10 20:40:42 +0100 |
| commit | 761604f9e4815e8f4355637ebb46052314cbed86 (patch) | |
| tree | b9cd6dde75ebf5897f8e67835522c6411d6ab7cb /src/ctrl/mouse.hpp | |
| parent | c666035bc6a51e4dd76daebefffaf8bbc951977c (diff) | |
| download | engine-761604f9e4815e8f4355637ebb46052314cbed86.tar.gz | |
renamed .h to .hpp
Diffstat (limited to 'src/ctrl/mouse.hpp')
| -rw-r--r-- | src/ctrl/mouse.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/ctrl/mouse.hpp b/src/ctrl/mouse.hpp new file mode 100644 index 0000000..8973499 --- /dev/null +++ b/src/ctrl/mouse.hpp @@ -0,0 +1,23 @@ +#ifndef CTRL_MOUSE_H +#define CTRL_MOUSE_H + +#include "math/vector.hpp" + +namespace engine::controllers { + +template<typename MouseMotionCallback> +class Mouse { + public: + constexpr Mouse(MouseMotionCallback mouse_motion_cb) : mouse_motion_cb{mouse_motion_cb} {} + + void mouse_motion_event(Vector2 rel) const & { + mouse_motion_cb(rel); + } + + private: + MouseMotionCallback mouse_motion_cb; +}; + +} + +#endif // CTRL_MOUSE_H |
