mirror of
https://github.com/glfw/glfw.git
synced 2025-06-07 16:24:57 +00:00
CursorMode DISABLED on Windows gives wrong coordinates
This commit is contained in:
parent
3eaf1255b2
commit
e199152474
@ -2096,20 +2096,22 @@ void _glfwPollEventsWin32(void)
|
||||
}
|
||||
}
|
||||
|
||||
window = _glfw.win32.disabledCursorWindow;
|
||||
if (window)
|
||||
{
|
||||
int width, height;
|
||||
_glfwGetWindowSizeWin32(window, &width, &height);
|
||||
// Fixing the problem where recentering the cursor when the mouse move breaks the lastCursorPosX and lastCursorPosY
|
||||
// and the coordinates sent in _glfwInputCursorPos are completly wrong.
|
||||
//window = _glfw.win32.disabledCursorWindow;
|
||||
//if (window)
|
||||
//{
|
||||
// int width, height;
|
||||
// _glfwGetWindowSizeWin32(window, &width, &height);
|
||||
|
||||
// NOTE: Re-center the cursor only if it has moved since the last call,
|
||||
// to avoid breaking glfwWaitEvents with WM_MOUSEMOVE
|
||||
if (window->win32.lastCursorPosX != width / 2 ||
|
||||
window->win32.lastCursorPosY != height / 2)
|
||||
{
|
||||
_glfwSetCursorPosWin32(window, width / 2, height / 2);
|
||||
}
|
||||
}
|
||||
// // NOTE: Re-center the cursor only if it has moved since the last call,
|
||||
// // to avoid breaking glfwWaitEvents with WM_MOUSEMOVE
|
||||
// if (window->win32.lastCursorPosX != width / 2 ||
|
||||
// window->win32.lastCursorPosY != height / 2)
|
||||
// {
|
||||
// _glfwSetCursorPosWin32(window, width / 2, height / 2);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
||||
void _glfwWaitEventsWin32(void)
|
||||
|
Loading…
Reference in New Issue
Block a user