Gainput  v1.0.0
GainputInputDeviceBuiltIn.h
1 
2 #ifndef GAINPUTINPUTDEVICEBUILTIN_H_
3 #define GAINPUTINPUTDEVICEBUILTIN_H_
4 
5 namespace gainput
6 {
7 
10 {
11  BuiltInButtonAccelerationX,
12  BuiltInButtonAccelerationY,
13  BuiltInButtonAccelerationZ,
14  BuiltInButtonGravityX,
15  BuiltInButtonGravityY,
16  BuiltInButtonGravityZ,
17  BuiltInButtonGyroscopeX,
18  BuiltInButtonGyroscopeY,
19  BuiltInButtonGyroscopeZ,
20  BuiltInButtonMagneticFieldX,
21  BuiltInButtonMagneticFieldY,
22  BuiltInButtonMagneticFieldZ,
23  BuiltInButtonCount_
24 };
25 
26 class InputDeviceBuiltInImpl;
27 
29 class GAINPUT_LIBEXPORT InputDeviceBuiltIn : public InputDevice
30 {
31 public:
33 
39  InputDeviceBuiltIn(InputManager& manager, DeviceId device, unsigned index, DeviceVariant variant);
42 
44  DeviceType GetType() const { return DT_BUILTIN; }
45  DeviceVariant GetVariant() const;
46  const char* GetTypeName() const { return "builtin"; }
47  bool IsValidButtonId(DeviceButtonId deviceButton) const;
48 
49  size_t GetAnyButtonDown(DeviceButtonSpec* outButtons, size_t maxButtonCount) const;
50 
51  size_t GetButtonName(DeviceButtonId deviceButton, char* buffer, size_t bufferLength) const;
52  ButtonType GetButtonType(DeviceButtonId deviceButton) const;
53  DeviceButtonId GetButtonByName(const char* name) const;
54 
55 protected:
56  void InternalUpdate(InputDeltaState* delta);
57 
58  DeviceState InternalGetState() const;
59 
60 private:
61  InputDeviceBuiltInImpl* impl_;
62 
63 };
64 
65 }
66 
67 #endif
68 
An input device for inputs that are directly built into the executing device (for example...
Definition: GainputInputDeviceBuiltIn.h:29
Manages all input devices and some other helpful stuff.
Definition: GainputInputManager.h:24
BuiltInButton
All valid device buttons for InputDeviceBuiltIn.
Definition: GainputInputDeviceBuiltIn.h:9
ButtonType
Type of an input device button.
Definition: GainputInputDevice.h:10
Stores a list of input state changes.
Definition: GainputInputDeltaState.h:9
Describes a device button on a specific device.
Definition: gainput.h:112
unsigned int DeviceId
ID of an input device.
Definition: gainput.h:107
DeviceState
State of an input device.
Definition: GainputInputDevice.h:59
DeviceVariant
Variant of an input device type.
Definition: GainputInputDevice.h:51
const char * GetTypeName() const
Returns the device type's name.
Definition: GainputInputDeviceBuiltIn.h:46
DeviceType
Type of an input device.
Definition: GainputInputDevice.h:37
Interface for anything that provides device inputs.
Definition: GainputInputDevice.h:33
DeviceType GetType() const
Returns DT_BUILTIN.
Definition: GainputInputDeviceBuiltIn.h:44
unsigned int DeviceButtonId
ID of a specific button unique to an input device.
Definition: gainput.h:109
Contains all Gainput related classes, types, and functions.
Definition: gainput.h:103