mirror of
https://github.com/glfw/glfw.git
synced 2026-09-19 15:25:50 +00:00
Removed glfwGetScrollOffset.
Scroll events do not represent an absolute state, but rather an interpretation of a relative change in state, like character input. So, like character input, there is no sane 'current state' to return. The here removed solution, that of accumulating an offset since the last call to event processing, is at best mildly confusing. If a user wishes to implement this solution, it is better for it to be explicit in client code than implicit in GLFW calls.
This commit is contained in:
-20
@@ -160,9 +160,6 @@ void _glfwInputChar(_GLFWwindow* window, int character)
|
||||
|
||||
void _glfwInputScroll(_GLFWwindow* window, double xoffset, double yoffset)
|
||||
{
|
||||
window->scrollX += xoffset;
|
||||
window->scrollY += yoffset;
|
||||
|
||||
if (window->callbacks.scroll)
|
||||
window->callbacks.scroll((GLFWwindow*) window, xoffset, yoffset);
|
||||
}
|
||||
@@ -370,23 +367,6 @@ GLFWAPI void glfwSetCursorPos(GLFWwindow* handle, int xpos, int ypos)
|
||||
_glfwPlatformSetCursorPos(window, xpos, ypos);
|
||||
}
|
||||
|
||||
GLFWAPI void glfwGetScrollOffset(GLFWwindow* handle, double* xoffset, double* yoffset)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
|
||||
if (!_glfwInitialized)
|
||||
{
|
||||
_glfwInputError(GLFW_NOT_INITIALIZED, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
if (xoffset)
|
||||
*xoffset = window->scrollX;
|
||||
|
||||
if (yoffset)
|
||||
*yoffset = window->scrollY;
|
||||
}
|
||||
|
||||
GLFWAPI void glfwSetKeyCallback(GLFWwindow* handle, GLFWkeyfun cbfun)
|
||||
{
|
||||
_GLFWwindow* window = (_GLFWwindow*) handle;
|
||||
|
||||
Reference in New Issue
Block a user