diff --git a/mouse.go b/mouse.go index 2e917f8..27e4363 100644 --- a/mouse.go +++ b/mouse.go @@ -52,3 +52,15 @@ func IsAnyMouseButtonDown(buttons ...MouseButton) bool { } return false } + +func MousePosition() (int, int) { + var state C.ALLEGRO_MOUSE_STATE + C.al_get_mouse_state(&state) + return int(state.x), int(state.y) +} + +func MousePositionScreen() (int, int, bool) { + var x, y C.int + var result = C.al_get_mouse_cursor_position(&x, &y) + return int(x), int(y), bool(result) +}