Platform/Win32/Win32Display: implement grabCursor()
This commit is contained in:
parent
0a1c18548d
commit
e64d9cdce0
2 changed files with 14 additions and 0 deletions
|
|
@ -127,6 +127,18 @@ void Win32Display::showCursor(bool value)
|
||||||
::SetCursor(m_cursor);
|
::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)
|
void Win32Display::setIcon(unsigned int width, unsigned int height, const uint8_t *pixels)
|
||||||
{
|
{
|
||||||
::HDC hdc;
|
::HDC hdc;
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,8 @@ public :
|
||||||
|
|
||||||
virtual void showCursor(bool value);
|
virtual void showCursor(bool value);
|
||||||
|
|
||||||
|
virtual void grabCursor(bool value);
|
||||||
|
|
||||||
protected :
|
protected :
|
||||||
|
|
||||||
void registerClass();
|
void registerClass();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue