blob: 3b45b4dc9bda77c6d7b43e9f03dabd3328357cc1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#ifndef CTRL_MOUSE_HPP
#define CTRL_MOUSE_HPP
#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(engine::math::Vector2 rel) const & {
mouse_motion_cb(rel);
}
private:
MouseMotionCallback mouse_motion_cb;
};
}
#endif // CTRL_MOUSE_HPP
|