libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
WheelHandler.h
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4
7
8namespace Ship {
9
17
27 public:
29 WheelHandler(std::shared_ptr<Window> window);
30
33
37 void Update();
38
44
50
57
64
65 private:
66 float CalcDirectionValue(CoordsF& coords, WheelDirection direction);
67 void UpdateAxisBuffer(float* buf, float input);
68
69 WheelDirections mDirections;
70 CoordsF mCoords;
71 CoordsF mBufferedCoords;
72 std::shared_ptr<Window> mWindow;
73};
74} // namespace Ship
Tracks mouse scroll-wheel state and converts it into axis-like values consumable by the input mapping...
Definition WheelHandler.h:26
WheelDirections GetDirections()
Returns the current horizontal and vertical scroll directions.
~WheelHandler()
Destructor.
CoordsF GetCoords()
Returns the raw scroll-wheel coordinates for the current frame.
float GetDirectionValue(WheelDirection direction)
Returns the instantaneous direction value for the given wheel direction.
float GetBufferedDirectionValue(WheelDirection direction)
Returns the buffered (smoothed) direction value for the given wheel direction.
void Update()
Samples the latest wheel data from the window back-end.
WheelHandler(std::shared_ptr< Window > window)
Constructs a WheelHandler with default (zero) state.
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14
WheelDirection
Identifies a scroll-wheel direction delivered to the input mapping system.
Definition KeyboardScancodes.h:149
Floating-point pixel coordinates.
Definition Window.h:32
Holds the current horizontal and vertical scroll-wheel directions.
Definition WheelHandler.h:13
WheelDirection X
Horizontal scroll direction.
Definition WheelHandler.h:14
WheelDirection Y
Vertical scroll direction.
Definition WheelHandler.h:15