diff options
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 |
