示例#1
0
        public void InvokeCursorEnter(Vector2 cursorPosition)
        {
            var pos = (cursorPosition - RenderPosition).ToPoint();

            CursorEnter?.Invoke(this, new GuiCursorEventArgs(pos));

            OnCursorEnter(pos);
        }
示例#2
0
 public unsafe GlfwEvents(WindowHandle *handle)
 {
     Handle = handle;
     GlfwProvider.GLFW.Value.SetCharCallback(handle, (a, b) => Char?.Invoke(a, b));
     GlfwProvider.GLFW.Value.SetKeyCallback(handle, (a, b, c, d, e) => Key?.Invoke(a, b, c, d, e));
     GlfwProvider.GLFW.Value.SetMouseButtonCallback(handle, (a, b, c, d) => MouseButton?.Invoke(a, b, c, d));
     GlfwProvider.GLFW.Value.SetCursorEnterCallback(handle, (a, b) => CursorEnter?.Invoke(a, b));
     GlfwProvider.GLFW.Value.SetCursorPosCallback(handle, (a, b, c) => CursorPos?.Invoke(a, b, c));
     GlfwProvider.GLFW.Value.SetScrollCallback(handle, (a, b, c) => Scroll?.Invoke(a, b, c));
 }