Exemplo n.º 1
0
    static void MousePosFunc(GLFWwindow* window, int x, int y) {
        GLWindow* glwnd = (GLWindow*)glfwGetWindowUserPointer(window);

        input::MouseEventArgs args;
        args.button = input::Nothing;
        args.state  = input::Move;
        args.flag   = g_key_flag;
        args.x      = x;
        args.y      = y;

        glwnd->onMouseEvent().raise(glwnd, args);
    }
Exemplo n.º 2
0
    static void MouseButtonFunc(GLFWwindow* window, int btn, int state) {
        GLWindow* glwnd = (GLWindow*)glfwGetWindowUserPointer(window);

        input::MouseEventArgs args;
        args.button = glfw_to_ukn_mouse(btn);
        args.state  = glfw_to_ukn_mouse_state(state);
        args.flag   = g_key_flag;

        // retrieve mouse pos
        glfwGetCursorPos(window, &args.x, &args.y);

        glwnd->onMouseEvent().raise(glwnd, args);
    }
Exemplo n.º 3
0
    static void ScrollFunc(GLFWwindow* window, double a, double b) {
        GLWindow* glwnd = (GLWindow*)glfwGetWindowUserPointer(window);
        
        input::MouseEventArgs args;
        args.button = input::Nothing;
        args.state  = input::Wheel;
        args.flag   = g_key_flag;
        args.x      = a;
        args.y      = b;
        args.wheel  = 0;

        glwnd->onMouseEvent().raise(glwnd, args);
    }