| 911 | } |
| 912 | |
| 913 | void SDLWindow::StartClippingCursor(const Rectangle& bounds) |
| 914 | { |
| 915 | if (!IsFocused()) |
| 916 | return; |
| 917 | |
| 918 | // The cursor is not fully constrained when positioned outside the clip region |
| 919 | SetMousePosition(bounds.GetCenter()); |
| 920 | |
| 921 | _isClippingCursor = true; |
| 922 | SDL_Rect rect{ (int)bounds.GetX(), (int)bounds.GetY(), (int)bounds.GetWidth(), (int)bounds.GetHeight() }; |
| 923 | SDL_SetWindowMouseRect(_window, &rect); |
| 924 | _clipCursorRect = bounds; |
| 925 | } |
| 926 | |
| 927 | void SDLWindow::EndClippingCursor() |
| 928 | { |