blob: 5c7af80260fe8452c69b3671e90c7597a9018d71 (
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(Vector2 rel) const & {
mouse_motion_cb(rel);
}
private:
MouseMotionCallback mouse_motion_cb;
};
}
#endif // CTRL_MOUSE_HPP
|