4#include "../types/types.hpp"
Singleton tracking mouse state and dispatching mouse events.
Definition mouse.hpp:50
static Mouse * instance
Singleton instance.
Definition mouse.hpp:63
void _fireEvent(const MouseEvent *event)
Dispatches a mouse event to listeners.
Definition mouse.cpp:86
Mouse()
Constructs the mouse tracker.
Definition mouse.cpp:97
static Mouse * getInstance()
Returns the singleton instance.
Definition mouse.cpp:102
void _cursorMoveHandler(GLFWwindow *window)
Handles a raw GLFW cursor move callback.
Definition mouse.cpp:57
Vector2 getCursorPosition()
Returns the current cursor position.
Definition mouse.cpp:93
void _mouseClickHandler(GLFWwindow *window, int button, int action, int mods)
Handles a raw GLFW mouse button callback.
Definition mouse.cpp:24
void _mouseEnterHandler(GLFWwindow *window, int entered)
Handles a raw GLFW cursor enter/leave callback.
Definition mouse.cpp:42
Vector2 cursorPos
Definition mouse.hpp:52
void _scrollWheelInputHandler(GLFWwindow *window, Vector2 offset)
Handles a raw GLFW scroll callback.
Definition mouse.cpp:72
Owns the application window, OpenGL context and the frame loop.
Definition window.hpp:34
Definition audiomanager.cpp:4
MouseButton
Mouse button identifiers, with named aliases for the common three.
Definition mouse.hpp:12
@ Middle
Middle button (alias of Button3).
MouseEventType
The kind of mouse event that occurred.
Definition mouse.hpp:27
@ Scroll
The scroll wheel moved.
@ MouseClick
A button was pressed.
@ CursorLeave
Cursor left the window.
@ MouseRelease
A button was released.
@ CursorEnter
Cursor entered the window.
@ CursorMove
Cursor moved within the window.
A mouse event carrying its type, button, position and scroll offset.
Definition mouse.hpp:37
Vector2 pos
Cursor position at the time the event fired.
Definition mouse.hpp:40
Vector2 offset
Scroll offset; only meaningful for scroll events.
Definition mouse.hpp:41
MouseEventType event
The kind of event.
Definition mouse.hpp:38
MouseButton button
Button involved; only meaningful for click/release events.
Definition mouse.hpp:39
Two-component floating-point vector.
Definition vector2.hpp:13