Skip to content

Commit 345abba

Browse files
committed
add MouseDownListener
1 parent 59ea9d6 commit 345abba

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

include/threepp/input/MouseListener.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,19 @@ namespace threepp {
4545
std::function<void(int, Vector2)> f_;
4646
};
4747

48+
struct MouseDownListener: MouseListener {
49+
50+
explicit MouseDownListener(std::function<void(int, const Vector2&)> f)
51+
: f_(std::move(f)) {}
52+
53+
void onMouseDown(int button, const Vector2& pos) override {
54+
f_(button, pos);
55+
}
56+
57+
private:
58+
std::function<void(int, Vector2)> f_;
59+
};
60+
4861
}// namespace threepp
4962

5063

0 commit comments

Comments
 (0)