diff --git a/examples/directx11_example/main.cpp b/examples/directx11_example/main.cpp index ea9a341..84d8673 100644 --- a/examples/directx11_example/main.cpp +++ b/examples/directx11_example/main.cpp @@ -317,7 +317,7 @@ io.MouseDown[1] = false; return true; case WM_MOUSEWHEEL: - io.MouseWheel = GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f; + io.MouseWheel += GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f; return true; case WM_MOUSEMOVE: // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.) diff --git a/examples/directx11_example/main.cpp b/examples/directx11_example/main.cpp index ea9a341..84d8673 100644 --- a/examples/directx11_example/main.cpp +++ b/examples/directx11_example/main.cpp @@ -317,7 +317,7 @@ io.MouseDown[1] = false; return true; case WM_MOUSEWHEEL: - io.MouseWheel = GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f; + io.MouseWheel += GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f; return true; case WM_MOUSEMOVE: // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.) diff --git a/examples/directx9_example/main.cpp b/examples/directx9_example/main.cpp index adb2bf3..047874c 100644 --- a/examples/directx9_example/main.cpp +++ b/examples/directx9_example/main.cpp @@ -153,7 +153,7 @@ io.MouseDown[1] = false; return true; case WM_MOUSEWHEEL: - io.MouseWheel = GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f; + io.MouseWheel += GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f; return true; case WM_MOUSEMOVE: // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.) diff --git a/examples/directx11_example/main.cpp b/examples/directx11_example/main.cpp index ea9a341..84d8673 100644 --- a/examples/directx11_example/main.cpp +++ b/examples/directx11_example/main.cpp @@ -317,7 +317,7 @@ io.MouseDown[1] = false; return true; case WM_MOUSEWHEEL: - io.MouseWheel = GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f; + io.MouseWheel += GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f; return true; case WM_MOUSEMOVE: // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.) diff --git a/examples/directx9_example/main.cpp b/examples/directx9_example/main.cpp index adb2bf3..047874c 100644 --- a/examples/directx9_example/main.cpp +++ b/examples/directx9_example/main.cpp @@ -153,7 +153,7 @@ io.MouseDown[1] = false; return true; case WM_MOUSEWHEEL: - io.MouseWheel = GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f; + io.MouseWheel += GET_WHEEL_DELTA_WPARAM(wParam) > 0 ? +1.0f : -1.0f; return true; case WM_MOUSEMOVE: // Mouse position, in pixels (set to -1,-1 if no mouse / on another screen, etc.) diff --git a/examples/opengl_example/main.cpp b/examples/opengl_example/main.cpp index 22e2b1b..61a9f36 100644 --- a/examples/opengl_example/main.cpp +++ b/examples/opengl_example/main.cpp @@ -114,7 +114,7 @@ static void glfw_scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { ImGuiIO& io = ImGui::GetIO(); - io.MouseWheel = (float)yoffset; // Use fractional mouse wheel, 1.0 unit 5 lines. + io.MouseWheel += (float)yoffset; // Use fractional mouse wheel, 1.0 unit 5 lines. } static void glfw_key_callback(GLFWwindow* window, int key, int scancode, int action, int mods) @@ -258,7 +258,6 @@ { ImGuiIO& io = ImGui::GetIO(); mousePressed[0] = mousePressed[1] = false; - io.MouseWheel = 0; glfwPollEvents(); UpdateImGui();