public static KeyboardStateO GetState(GlfwWindowPtr window)
        {
            KeyboardStateO result = new KeyboardStateO();

            for (int i = 0; i < allKeys.Length; ++i)
            {
                Key k = allKeys[i];
                result.keys[k] = Glfw.GetKey(window, k);
            }

            return(result);
        }
Esempio n. 2
0
        public static MouseStateO GetMouseState(GlfwWindowPtr window)
        {
            MouseStateO result = new MouseStateO();

            result.LeftButton   = Glfw.GetMouseButton(window, MouseButton.Left);
            result.MiddleButton = Glfw.GetMouseButton(window, MouseButton.Middle);
            result.RightButton  = Glfw.GetMouseButton(window, MouseButton.Right);
            double x, y;

            Glfw.GetCursorPos(window, out x, out y);
            result.X = x;
            result.Y = y;

            return(result);
        }