aboutsummaryrefslogtreecommitdiff
path: root/src/ctrl/mouse.h
blob: 521b0a4f5969cb7988d10e1efbdc489b925da5fa (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_H
#define CTRL_MOUSE_H

#include "math/vector.h"

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