fix(macos): Mouse input broken in-game (#2550)

Co-authored-by: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com>
This commit is contained in:
Vithorio Polten 2024-06-12 18:26:02 -03:00 committed by GitHub
commit 02ddbefd44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 305 additions and 72 deletions

View file

@ -542,6 +542,21 @@ namespace platf {
send_input(i);
}
util::point_t
get_mouse_loc(input_t &input) {
throw std::runtime_error("not implemented yet, has to pass tests");
// TODO: Tests are failing, something wrong here?
POINT p;
if (!GetCursorPos(&p)) {
return util::point_t { 0.0, 0.0 };
}
return util::point_t {
(double) p.x,
(double) p.y
};
}
void
button_mouse(input_t &input, int button, bool release) {
INPUT i {};