Function mouseWheelCallback

Synopsis

#include <Source/Falcor/Core/Window.cpp>

static void mouseWheelCallback(GLFWwindow *pGlfwWindow, double scrollX, double scrollY)

Description

No description yet.

Source

Lines 147-161 in Source/Falcor/Core/Window.cpp.

static void mouseWheelCallback(GLFWwindow* pGlfwWindow, double scrollX, double scrollY)
{
    Window* pWindow = (Window*)glfwGetWindowUserPointer(pGlfwWindow);
    if (pWindow != nullptr)
    {
        MouseEvent event;
        event.type = MouseEvent::Type::Wheel;
        double x, y;
        glfwGetCursorPos(pGlfwWindow, &x, &y);
        event.pos = calcMousePos(x, y, pWindow->getMouseScale());
        event.wheelDelta = (float2(float(scrollX), float(scrollY)));
        pWindow->mpCallbacks->handleMouseEvent(event);
    }
}





Add Discussion as Guest

Log in to DocsForge