mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 21:14:35 +00:00
Moved scroll offset clearing to shared code.
This commit is contained in:
parent
a4a860057d
commit
c4250ca384
@ -1690,12 +1690,6 @@ void _glfwPlatformPollEvents(void)
|
|||||||
MSG msg;
|
MSG msg;
|
||||||
_GLFWwindow* window;
|
_GLFWwindow* window;
|
||||||
|
|
||||||
for (window = _glfwLibrary.windowListHead; window; window = window->next)
|
|
||||||
{
|
|
||||||
window->scrollX = 0;
|
|
||||||
window->scrollY = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
window = _glfwLibrary.cursorLockWindow;
|
window = _glfwLibrary.cursorLockWindow;
|
||||||
if (window)
|
if (window)
|
||||||
{
|
{
|
||||||
|
22
src/window.c
22
src/window.c
@ -70,6 +70,22 @@ static void closeFlaggedWindows(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//========================================================================
|
||||||
|
// Clear scroll offsets for all windows
|
||||||
|
//========================================================================
|
||||||
|
|
||||||
|
void clearScrollOffsets(void)
|
||||||
|
{
|
||||||
|
_GLFWwindow* window;
|
||||||
|
|
||||||
|
for (window = _glfwLibrary.windowListHead; window; window = window->next)
|
||||||
|
{
|
||||||
|
window->scrollX = 0;
|
||||||
|
window->scrollY = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//========================================================================
|
//========================================================================
|
||||||
// Clear all input state
|
// Clear all input state
|
||||||
//========================================================================
|
//========================================================================
|
||||||
@ -90,7 +106,7 @@ void clearInputState(_GLFWwindow* window)
|
|||||||
window->mousePosX = 0;
|
window->mousePosX = 0;
|
||||||
window->mousePosY = 0;
|
window->mousePosY = 0;
|
||||||
|
|
||||||
// Set mouse wheel position to 0
|
// Set scroll offsets to (0,0)
|
||||||
window->scrollX = 0;
|
window->scrollX = 0;
|
||||||
window->scrollY = 0;
|
window->scrollY = 0;
|
||||||
|
|
||||||
@ -1193,6 +1209,8 @@ GLFWAPI void glfwPollEvents(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearScrollOffsets();
|
||||||
|
|
||||||
_glfwPlatformPollEvents();
|
_glfwPlatformPollEvents();
|
||||||
|
|
||||||
closeFlaggedWindows();
|
closeFlaggedWindows();
|
||||||
@ -1211,6 +1229,8 @@ GLFWAPI void glfwWaitEvents(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
clearScrollOffsets();
|
||||||
|
|
||||||
_glfwPlatformWaitEvents();
|
_glfwPlatformWaitEvents();
|
||||||
|
|
||||||
closeFlaggedWindows();
|
closeFlaggedWindows();
|
||||||
|
@ -1813,12 +1813,6 @@ void _glfwPlatformPollEvents(void)
|
|||||||
{
|
{
|
||||||
_GLFWwindow* window;
|
_GLFWwindow* window;
|
||||||
|
|
||||||
for (window = _glfwLibrary.windowListHead; window; window = window->next)
|
|
||||||
{
|
|
||||||
window->scrollX = 0;
|
|
||||||
window->scrollY = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Flag that the cursor has not moved
|
// Flag that the cursor has not moved
|
||||||
window = _glfwLibrary.cursorLockWindow;
|
window = _glfwLibrary.cursorLockWindow;
|
||||||
if (window)
|
if (window)
|
||||||
|
Loading…
Reference in New Issue
Block a user