|
cangine
|
Singleton tracking mouse state and dispatching mouse events. More...
#include <mouse.hpp>

Public Member Functions | |
| Vector2 | getCursorPosition () |
| Returns the current cursor position. | |
| Mouse () | |
| Constructs the mouse tracker. | |
Static Public Member Functions | |
| static Mouse * | getInstance () |
| Returns the singleton instance. | |
Private Member Functions | |
| void | _mouseClickHandler (GLFWwindow *window, int button, int action, int mods) |
| Handles a raw GLFW mouse button callback. | |
| void | _mouseEnterHandler (GLFWwindow *window, int entered) |
| Handles a raw GLFW cursor enter/leave callback. | |
| void | _cursorMoveHandler (GLFWwindow *window) |
| Handles a raw GLFW cursor move callback. | |
| void | _scrollWheelInputHandler (GLFWwindow *window, Vector2 offset) |
| Handles a raw GLFW scroll callback. | |
| void | _fireEvent (const MouseEvent *event) |
| Dispatches a mouse event to listeners. | |
Private Attributes | |
| Vector2 | cursorPos |
Static Private Attributes | |
| static Mouse * | instance = nullptr |
| Singleton instance. | |
Friends | |
| class | Window |
Singleton tracking mouse state and dispatching mouse events.
Receives raw GLFW callbacks via Window and exposes the current cursor position.
| cangine::Mouse::Mouse | ( | ) |
Constructs the mouse tracker.
|
private |
Handles a raw GLFW cursor move callback.
|
private |
Dispatches a mouse event to listeners.
|
private |
Handles a raw GLFW mouse button callback.
|
private |
Handles a raw GLFW cursor enter/leave callback.
|
private |
Handles a raw GLFW scroll callback.
| Vector2 cangine::Mouse::getCursorPosition | ( | ) |
Returns the current cursor position.
|
static |
Returns the singleton instance.
|
friend |
|
private |
Last known cursor position.
|
staticprivate |
Singleton instance.