41 auto update(
float dt) -> void;
51 auto getInputMap()
const ->
const std::unordered_map<int, std::string>&;
65 static auto mouseButtonCallback(GLFWwindow* window,
int pressedButton,
int action,
int mods) -> void;
auto getEnabled() const -> bool
Returns if mouse input is currently enabled or not.
Definition Mouse.cpp:89
auto update(float dt) -> void
Definition Mouse.cpp:57
auto getInputMap() const -> const std::unordered_map< int, std::string > &
Returns the map of all the registered mouse buttons and their corresponding event.
Definition Mouse.cpp:99
static auto mouseButtonCallback(GLFWwindow *window, int pressedButton, int action, int mods) -> void
Callback used by GLFW whenever a button on the mouse is pressed/released. Broadcasts a message on pre...
Definition Mouse.cpp:129
static constexpr auto mouseDeviceID
ID representing all mouse input done.
Definition Mouse.h:86
Vector4D mouseWorldCoords
Definition Mouse.h:80
static constexpr auto getMouseDeviceID() -> int
Used to keep our use of the Mouse input device ID consistent.
Definition Mouse.h:69
Mouse()
Definition Mouse.cpp:47
static const Vector4D outOfBoundsPosition
Definition Mouse.h:78
auto getMousePosition() const -> std::pair< float, float >
Gets the mouse position in GLFW space (top left is 0,0).
Definition Mouse.cpp:104
auto getMouseWorldCoords() const -> const Vector4D &
Gets the mouse position in the world of the gameplay viewport (center is 0,0).
Definition Mouse.cpp:112
auto setEnabled(bool newState) -> void
Sets whether input from the mouse is accepted or not.
Definition Mouse.cpp:94
auto showMenu() -> void
Definition Mouse.cpp:73
std::unordered_map< int, std::string > mouseButtonMap
A map that takes GLFW mouse codes and maps them to input event names.
Definition Mouse.h:83
bool enabled
Definition Mouse.h:76