Class that tracks mouse position and detects whenever a mouse button is pressed.
More...
#include <Mouse.h>
|
| | Mouse () |
| auto | update (float dt) -> void |
| auto | showMenu () -> void |
| auto | getEnabled () const -> bool |
| | Returns if mouse input is currently enabled or not.
|
| auto | setEnabled (bool newState) -> void |
| | Sets whether input from the mouse is accepted or not.
|
| auto | getInputMap () const -> const std::unordered_map< int, std::string > & |
| | Returns the map of all the registered mouse buttons and their corresponding event.
|
| auto | getMousePosition () const -> std::pair< float, float > |
| | Gets the mouse position in GLFW space (top left is 0,0).
|
| auto | getMouseWorldCoords () const -> const Vector4D & |
| | Gets the mouse position in the world of the gameplay viewport (center is 0,0).
|
|
| 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 press.
|
| static constexpr auto | getMouseDeviceID () -> int |
| | Used to keep our use of the Mouse input device ID consistent.
|
Class that tracks mouse position and detects whenever a mouse button is pressed.
@Mouse.h
◆ Mouse()
◆ getEnabled()
| auto Mouse::getEnabled |
( |
| ) |
const->bool |
Returns if mouse input is currently enabled or not.
◆ getInputMap()
| auto Mouse::getInputMap |
( |
| ) |
const->conststd::unordered_map< int, std::string > & |
Returns the map of all the registered mouse buttons and their corresponding event.
◆ getMouseDeviceID()
| constexpr auto Mouse::getMouseDeviceID |
( |
| ) |
->int |
|
inlinestaticconstexpr |
Used to keep our use of the Mouse input device ID consistent.
◆ getMousePosition()
| auto Mouse::getMousePosition |
( |
| ) |
const->std::pair< float, float > |
Gets the mouse position in GLFW space (top left is 0,0).
This does not take into account where the window is in editor
◆ getMouseWorldCoords()
| auto Mouse::getMouseWorldCoords |
( |
| ) |
const->constVector4D & |
Gets the mouse position in the world of the gameplay viewport (center is 0,0).
◆ mouseButtonCallback()
| auto Mouse::mouseButtonCallback |
( |
GLFWwindow * | window, |
|
|
int | pressedButton, |
|
|
int | action, |
|
|
int | mods )->void |
|
static |
Callback used by GLFW whenever a button on the mouse is pressed/released. Broadcasts a message on press.
◆ setEnabled()
| auto Mouse::setEnabled |
( |
bool | newState | ) |
->void |
Sets whether input from the mouse is accepted or not.
◆ showMenu()
| auto Mouse::showMenu |
( |
| ) |
->void |
◆ update()
| auto Mouse::update |
( |
float | dt | ) |
->void |
◆ enabled
| bool Mouse::enabled = true |
|
private |
◆ mouseButtonMap
| std::unordered_map<int, std::string> Mouse::mouseButtonMap |
|
private |
A map that takes GLFW mouse codes and maps them to input event names.
◆ mouseDeviceID
| auto Mouse::mouseDeviceID = -2 |
|
staticconstexprprivate |
ID representing all mouse input done.
◆ mouseWorldCoords
| Vector4D Mouse::mouseWorldCoords = {0.f, 0.f, 0.f, 1.f} |
|
private |
◆ outOfBoundsPosition
| const Vector4D Mouse::outOfBoundsPosition |
|
staticprivate |
The documentation for this class was generated from the following files:
- /home/egrazil/sites/Brunot/The House/source/Framework/Mouse.h
- /home/egrazil/sites/Brunot/The House/source/Framework/Mouse.cpp