| 869 | } |
| 870 | |
| 871 | void SDLWindow::StartTrackingMouse(bool useMouseScreenOffset) |
| 872 | { |
| 873 | if (_isTrackingMouse) |
| 874 | return; |
| 875 | |
| 876 | _isTrackingMouse = true; |
| 877 | _trackingMouseOffset = Float2::Zero; |
| 878 | _isUsingMouseOffset = useMouseScreenOffset; |
| 879 | |
| 880 | if (_visible) |
| 881 | { |
| 882 | if (!SDL_CaptureMouse(true)) |
| 883 | { |
| 884 | if (!SDLPlatform::UsesWayland()) // Suppress "That operation is not supported" errors |
| 885 | LOG(Warning, "SDL_CaptureMouse: {0}", String(SDL_GetError())); |
| 886 | } |
| 887 | |
| 888 | // For viewport camera mouse tracking we want to use relative mode for best precision |
| 889 | if (_cursor == CursorType::Hidden) |
| 890 | Input::Mouse->SetRelativeMode(true, this); |
| 891 | } |
| 892 | } |
| 893 | |
| 894 | void SDLWindow::EndTrackingMouse() |
| 895 | { |
nothing calls this directly
no test coverage detected