GetMouseButton() public static method

public static GetMouseButton ( GlfwWindowPtr window, MouseButton button ) : bool
window GlfwWindowPtr
button MouseButton
return bool
Exemplo n.º 1
0
        public static MouseState GetMouseState(GlfwWindowPtr window)
        {
            MouseState result = new MouseState();

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

            Glfw.GetCursorPos(window, out x, out y);
            result.X = x;
            result.Y = y;
            return(result);
        }
Exemplo n.º 2
0
        public static MouseState GetMouseState()
        {
            MouseState result = new MouseState();

            result.LeftButton   = Glfw.GetMouseButton(MouseButton.LeftButton);
            result.MiddleButton = Glfw.GetMouseButton(MouseButton.MiddleButton);
            result.RightButton  = Glfw.GetMouseButton(MouseButton.RightButton);
            result.ScrollWheel  = Glfw.GetMouseWheel();
            int x, y;

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

            return(result);
        }