Add ClipCursor (Windows only)

This commit is contained in:
Scott Longley
2022-02-18 21:14:08 +10:00
parent 69a1e007a6
commit 8db4c3cfff
4 changed files with 55 additions and 0 deletions

View File

@@ -564,6 +564,34 @@ void WindowsWindow::EndTrackingMouse()
}
}
void WindowsWindow::StartClippingCursor(const Rectangle& bounds)
{
ASSERT(HasHWND());
if (!_isClippingCursor)
{
_isClippingCursor = true;
}
const RECT lpRect = {
bounds.GetUpperLeft().X,
bounds.GetUpperLeft().Y,
bounds.GetBottomRight().X,
bounds.GetBottomRight().Y
};
ClipCursor(&lpRect);
}
void WindowsWindow::EndClippingMouse()
{
if (_isClippingCursor)
{
_isClippingCursor = false;
ClipCursor(NULL);
}
}
void WindowsWindow::SetCursor(CursorType type)
{
// Base