Gainput  v1.0.0
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
GainputInputDeltaState.h
1 
2 #ifndef GAINPUTINPUTDELTASTATE_H_
3 #define GAINPUTINPUTDELTASTATE_H_
4 
5 namespace gainput
6 {
7 
9 class GAINPUT_LIBEXPORT InputDeltaState
10 {
11 public:
12  InputDeltaState(Allocator& allocator);
13 
15 
21  void AddChange(DeviceId device, DeviceButtonId deviceButton, bool oldValue, bool newValue);
23 
29  void AddChange(DeviceId device, DeviceButtonId deviceButton, float oldValue, float newValue);
30 
32  void Clear();
33 
35 
38  void NotifyListeners(Array<InputListener*>& listeners) const;
39 
40 private:
41  struct Change
42  {
43  DeviceId device;
44  DeviceButtonId deviceButton;
45  ButtonType type;
46  union
47  {
48  bool b;
49  float f;
50  } oldValue, newValue;
51  };
52 
53  Array<Change> changes_;
54 };
55 
56 }
57 
58 #endif
59 
A std::vector-like data container for POD-types.
Definition: GainputContainers.h:96
ButtonType
Type of an input device button.
Definition: GainputInputDevice.h:10
Stores a list of input state changes.
Definition: GainputInputDeltaState.h:9
unsigned int DeviceId
ID of an input device.
Definition: gainput.h:107
unsigned int DeviceButtonId
ID of a specific button unique to an input device.
Definition: gainput.h:109
Interface used to pass custom allocators to the library.
Definition: GainputAllocator.h:16
Contains all Gainput related classes, types, and functions.
Definition: gainput.h:103