2024-04-16 19:27:05 -03:00
|
|
|
#ifndef XNA_INPUT_MOUSE_HPP
|
|
|
|
#define XNA_INPUT_MOUSE_HPP
|
|
|
|
|
|
|
|
#include "../default.hpp"
|
|
|
|
|
|
|
|
namespace xna {
|
2024-05-21 20:43:37 -03:00
|
|
|
struct MouseState {
|
2024-04-17 09:48:48 -03:00
|
|
|
ButtonState LeftButton{ ButtonState::Released };
|
|
|
|
ButtonState RightButton{ ButtonState::Released };
|
|
|
|
ButtonState MiddleButton{ ButtonState::Released };
|
|
|
|
ButtonState XButton1{ ButtonState::Released };
|
|
|
|
ButtonState XButton2{ ButtonState::Released };
|
2024-04-16 19:27:05 -03:00
|
|
|
int X{ 0 };
|
|
|
|
int Y{ 0 };
|
|
|
|
int ScroolWheelValue{ 0 };
|
|
|
|
};
|
|
|
|
|
2024-06-22 16:24:11 -03:00
|
|
|
//Allows retrieval of position and button clicks from a mouse input device.
|
2024-05-21 20:43:37 -03:00
|
|
|
class Mouse {
|
2024-04-16 19:27:05 -03:00
|
|
|
public:
|
2024-06-22 16:24:11 -03:00
|
|
|
//Gets the current state of the mouse, including mouse position and buttons pressed.
|
2024-04-16 19:27:05 -03:00
|
|
|
static MouseState GetState();
|
2024-06-22 16:24:11 -03:00
|
|
|
|
2024-04-16 19:27:05 -03:00
|
|
|
static bool IsConnected();
|
|
|
|
static bool IsVisible();
|
|
|
|
static void IsVisible(bool value);
|
2024-07-08 09:40:48 -03:00
|
|
|
static void ResetScrollWheel();
|
2024-05-21 20:43:37 -03:00
|
|
|
|
2024-06-22 16:24:11 -03:00
|
|
|
private:
|
|
|
|
friend class Game;
|
2024-05-21 20:43:37 -03:00
|
|
|
static void Initialize();
|
|
|
|
|
2024-07-08 09:40:48 -03:00
|
|
|
Mouse() = default;
|
|
|
|
Mouse(Mouse&) = default;
|
|
|
|
Mouse(Mouse&&) = default;
|
|
|
|
|
2024-05-21 20:43:37 -03:00
|
|
|
public:
|
|
|
|
struct PlatformImplementation;
|
2024-06-22 16:24:11 -03:00
|
|
|
inline static uptr<PlatformImplementation> impl = nullptr;
|
2024-04-16 19:27:05 -03:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|