41 auto update(
float dt) -> void;
57 auto getInputMap()
const ->
const std::unordered_map<int, std::string>&;
66 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:116
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:139
auto disable() -> void
disables mouse input while also hiding the cursor
Definition Mouse.cpp:132
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:170
static constexpr auto mouseDeviceID
ID representing all mouse input done.
Definition Mouse.h:94
Vector4D mouseWorldCoords
Definition Mouse.h:87
static constexpr auto getMouseDeviceID() -> int
Used to keep our use of the Mouse input device ID consistent.
Definition Mouse.h:70
static auto getAbsoluteMousePosition() -> std::pair< float, float >
Helper function that gets the mouse position in GLFW space (top left is 0,0).
Definition Mouse.cpp:144
Mouse()
Definition Mouse.cpp:47
static const Vector4D outOfBoundsPosition
Definition Mouse.h:85
auto getMouseWorldCoords() const -> const Vector4D &
Gets the mouse position in the world of the gameplay viewport (center is 0,0).
Definition Mouse.cpp:152
auto setEnabled(bool newState) -> void
Sets whether input from the mouse is accepted or not.
Definition Mouse.cpp:121
auto showMenu() -> void
Definition Mouse.cpp:99
std::unordered_map< int, std::string > mouseButtonMap
A map that takes GLFW mouse codes and maps them to input event names.
Definition Mouse.h:91
Vector4D oldMouseWorldCoords
Definition Mouse.h:88
bool enabled
Definition Mouse.h:83
auto enable() -> void
Enables mouse input while also making the selector visible.
Definition Mouse.cpp:126