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); }
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); }
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); }