#include <InputDevice.h>
Classes | |
| struct | DimInfo |
Public Types | |
| enum | Type { Keyboard, Mouse, GameController } |
Public Member Functions | |
| IDirectInputDevice8 * | GetInterface () |
| const IDirectInputDevice8 * | GetInterface () const |
| const DIDATAFORMAT * | GetDataFormat () const |
| const DIDEVICEINSTANCE * | GetDeviceInstance () const |
| Type | GetType () const |
| const cl7::string_type & | GetName () const |
| const GUID & | GetGUID () const |
| unsigned | GetDimensionCount () const |
| bool | UpdateState (const float time) |
| float | GetState (const unsigned dimension) const |
| float | GetOldState (const unsigned dimension) const |
| float | GetActionTime (const unsigned dimension) const |
Protected Member Functions | |
| virtual | ~InputDevice (void) |
| InputDevice (InputDeviceManager *manager, const cl7::string_type &identifier, const Type type, const DIDATAFORMAT *data_format, const unsigned dimension_count) | |
| virtual errorcodes::ErrorCode | _CreateDeviceInterface (const DIDEVICEINSTANCE *device_instance) |
| virtual errorcodes::ErrorCode | _ReleaseDeviceInterface () |
| bool | _GetDeviceState (unsigned bytes, void *buffer) |
Protected Attributes | |
| friend | InputDeviceManager |
Base class for input devices (keyboard, mouse, joystick, gamepad etc.).
| xl7::directinput::devices::InputDevice::~InputDevice | ( | void | ) | [protected, virtual] |
Destructor.
| xl7::directinput::devices::InputDevice::InputDevice | ( | InputDeviceManager * | manager, | |
| const cl7::string_type & | identifier, | |||
| const Type | type, | |||
| const DIDATAFORMAT * | data_format, | |||
| const unsigned | dim_count | |||
| ) | [protected] |
Explicit constructor.
| errorcodes::ErrorCode xl7::directinput::devices::InputDevice::_CreateDeviceInterface | ( | const DIDEVICEINSTANCE * | device_instance | ) | [protected, virtual] |
Creates the DirectInput device interface.
Reimplemented in xl7::directinput::devices::GameController, xl7::directinput::devices::Keyboard, and xl7::directinput::devices::Mouse.
| bool xl7::directinput::devices::InputDevice::_GetDeviceState | ( | unsigned | bytes, | |
| void * | buffer | |||
| ) | [protected] |
Grabs the input device state.
| errorcodes::ErrorCode xl7::directinput::devices::InputDevice::_ReleaseDeviceInterface | ( | ) | [protected, virtual] |
Releases the DirectInput device interface.
| float xl7::directinput::devices::InputDevice::GetActionTime | ( | const unsigned | dimension | ) | const |
Returns the time (in seconds) of the given dimension being in action (or 0).
| const DIDATAFORMAT* xl7::directinput::devices::InputDevice::GetDataFormat | ( | ) | const [inline] |
Returns the data format.
| const DIDEVICEINSTANCE* xl7::directinput::devices::InputDevice::GetDeviceInstance | ( | ) | const [inline] |
Returns the device instance.
| unsigned xl7::directinput::devices::InputDevice::GetDimensionCount | ( | ) | const [inline] |
Returns the number of dimensions of the input device.
| const GUID& xl7::directinput::devices::InputDevice::GetGUID | ( | ) | const [inline] |
Returns the globally unique ID of the device.
| const IDirectInputDevice8* xl7::directinput::devices::InputDevice::GetInterface | ( | ) | const [inline] |
Returns the DirectInput device interface.
| IDirectInputDevice8* xl7::directinput::devices::InputDevice::GetInterface | ( | ) | [inline] |
Returns the DirectInput device interface.
| const cl7::string_type& xl7::directinput::devices::InputDevice::GetName | ( | ) | const [inline] |
Returns the name of the device (e.g. "Keyboard").
| float xl7::directinput::devices::InputDevice::GetOldState | ( | const unsigned | dimension | ) | const |
Returns the previous state of the given dimension (button, axis, slider, etc.).
| float xl7::directinput::devices::InputDevice::GetState | ( | const unsigned | dimension | ) | const |
Returns the current state of the given dimension (button, axis, slider, etc.).
| Type xl7::directinput::devices::InputDevice::GetType | ( | ) | const [inline] |
Returns the type of the input device.
| bool xl7::directinput::devices::InputDevice::UpdateState | ( | const float | time | ) |
Updates the current state.
friend xl7::directinput::devices::InputDevice::InputDeviceManager [protected] |
1.7.1