1
0
Fork 0

Platform/Win32/Win32Display: implement grabCursor()

This commit is contained in:
Henrik Hautakoski 2020-11-03 17:05:06 +01:00
parent 0a1c18548d
commit e64d9cdce0
2 changed files with 14 additions and 0 deletions

View file

@ -127,6 +127,18 @@ void Win32Display::showCursor(bool value)
::SetCursor(m_cursor);
}
void Win32Display::grabCursor(bool value)
{
if (value) {
RECT rect;
GetClientRect(m_handle, &rect);
MapWindowPoints(m_handle, NULL, reinterpret_cast<LPPOINT>(&rect), 2);
ClipCursor(&rect);
} else {
ClipCursor(NULL);
}
}
void Win32Display::setIcon(unsigned int width, unsigned int height, const uint8_t *pixels)
{
::HDC hdc;