mirror of
https://github.com/glfw/glfw.git
synced 2025-10-03 21:30:57 +00:00
Checking for error
Using GetClientRect, ClientToScreen and ClipCursor return values.
This commit is contained in:
parent
08b3af4387
commit
c044bbcb4d
@ -71,13 +71,18 @@ static getWindowExStyle(const _GLFWwindow* window)
|
||||
|
||||
// Updates the cursor clip rect
|
||||
//
|
||||
static void updateClipRect(_GLFWwindow* window)
|
||||
static BOOL updateClipRect(_GLFWwindow* window)
|
||||
{
|
||||
RECT clipRect;
|
||||
GetClientRect(window->win32.handle, &clipRect);
|
||||
ClientToScreen(window->win32.handle, (POINT*) &clipRect.left);
|
||||
ClientToScreen(window->win32.handle, (POINT*) &clipRect.right);
|
||||
ClipCursor(&clipRect);
|
||||
if (GetClientRect(window->win32.handle, &clipRect))
|
||||
{
|
||||
if (ClientToScreen(window->win32.handle, (POINT*) &clipRect.left))
|
||||
{
|
||||
if (ClientToScreen(window->win32.handle, (POINT*) &clipRect.right))
|
||||
return ClipCursor(&clipRect);
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Hide the mouse cursor
|
||||
|
Loading…
Reference in New Issue
Block a user