Orxonox: OIS::Win32JoyStick Class Reference

# OIS::Win32JoyStick Class Reference

`#include <src/ois/win32/Win32JoyStick.h>`

Inheritance diagram for OIS::Win32JoyStick:

List of all members.

## Public Member Functions

virtual void | _initialize ()
virtual void | capture ()
virtual Interface * | queryInterface (Interface::IType type)
virtual void | setBuffered (bool buffered)
| Win32JoyStick (InputManager *creator, IDirectInput8 *pDI, bool buffered, DWORD coopSettings, const JoyStickInfo &info)
virtual | ~Win32JoyStick ()

## Protected Member Functions

bool | _changePOV (int pov, DIDEVICEOBJECTDATA &di)
bool | _doButtonClick (int button, DIDEVICEOBJECTDATA &di)
void | _enumerate ()
| Enumerates all things.

## Static Protected Member Functions

static BOOL CALLBACK | DIEnumDeviceObjectsCallback (LPCDIDEVICEOBJECTINSTANCE lpddoi, LPVOID pvRef)
| Enumerate axis callback.
static BOOL CALLBACK | DIEnumEffectsCallback (LPCDIEFFECTINFO pdei, LPVOID pvRef)
| Enumerate Force Feedback callback.

## Protected Attributes

int | _AxisNumber
| Mapping.
DWORD | coopSetting
GUID | deviceGuid
Win32ForceFeedback * | ff_device
| A force feedback device.
IDirectInput8 * | mDirectInput
IDirectInputDevice8 * | mJoyStick

## Constructor & Destructor Documentation

Win32JoyStick::Win32JoyStick | ( | InputManager * | creator,
|  | IDirectInput8 * | pDI,
|  | bool | buffered,
|  | DWORD | coopSettings,
|  | const JoyStickInfo & | info |
| ) |  |  |

References coopSetting, deviceGuid, OIS::JoyStickInfo::deviceID, ff_device, mDirectInput, and mJoyStick.

Win32JoyStick::~Win32JoyStick | ( |  | ) | `[virtual]`

References deviceGuid, OIS::JoyStickInfo::deviceID, OIS::JoyStickInfo::devId, ff_device, OIS::Object::mCreator, OIS::Object::mDevID, mJoyStick, OIS::Object::mVendor, and OIS::JoyStickInfo::vendor.

## Member Function Documentation

bool Win32JoyStick::_changePOV | ( | int | pov,
|  | DIDEVICEOBJECTDATA & | di |
| ) |  |  | `[protected]`

References OIS::Pov::Centered, OIS::Pov::direction, OIS::Pov::East, OIS::Object::mBuffered, OIS::JoyStick::mListener, OIS::JoyStickState::mPOV, OIS::JoyStick::mState, OIS::Pov::North, OIS::Pov::NorthEast, OIS::Pov::NorthWest, OIS::JoyStickListener::povMoved(), OIS::Pov::South, OIS::Pov::SouthEast, OIS::Pov::SouthWest, and OIS::Pov::West.

Referenced by capture().

bool Win32JoyStick::_doButtonClick | ( | int | button,
|  | DIDEVICEOBJECTDATA & | di |
| ) |  |  | `[protected]`

References OIS::JoyStickListener::buttonPressed(), OIS::JoyStickListener::buttonReleased(), OIS::Object::mBuffered, OIS::JoyStickState::mButtons, OIS::JoyStick::mListener, and OIS::JoyStick::mState.

Referenced by capture().

void Win32JoyStick::_enumerate | ( |  | ) | `[protected]`

Enumerates all things.

References _AxisNumber, DIEnumDeviceObjectsCallback(), DIEnumEffectsCallback(), OIS::JoyStickState::mAxes, OIS::JoyStickState::mButtons, mJoyStick, OIS::JoyStick::mPOVs, and OIS::JoyStick::mState.

Referenced by _initialize().

void Win32JoyStick::_initialize | ( |  | ) | `[virtual]`

Remarks:
  Internal... Do not call this directly.

Implements OIS::Object.

References _enumerate(), capture(), OIS::JoyStickState::clear(), coopSetting, deviceGuid, OIS::E_General, ff_device, JOYSTICK_DX_BUFFERSIZE, OIS::JoyStickState::mAxes, OIS::Object::mCreator, mDirectInput, mJoyStick, OIS::JoyStick::mState, and OIS_EXCEPT.

void Win32JoyStick::capture | ( |  | ) | `[virtual]`

Remarks:
  Used for updating call once per frame before checking state or to update events

Implements OIS::Object.

References _changePOV(), _doButtonClick(), OIS::Slider::abX, OIS::Slider::abY, OIS::JoyStickListener::axisMoved(), DIJOFS_BUTTON, DIJOFS_POV, DIJOFS_SLIDER0, DIJOFS_SLIDER1, DIJOFS_SLIDER2, DIJOFS_SLIDER3, JOYSTICK_DX_BUFFERSIZE, OIS::JoyStickState::mAxes, OIS::Object::mBuffered, mJoyStick, OIS::JoyStick::mListener, OIS::JoyStickState::mSliders, OIS::JoyStick::mState, and OIS::JoyStickListener::sliderMoved().

Referenced by _initialize().

BOOL CALLBACK Win32JoyStick::DIEnumDeviceObjectsCallback | ( | LPCDIDEVICEOBJECTINSTANCE | lpddoi,
|  | LPVOID | pvRef |
| ) |  |  | `[static, protected]`

Enumerate axis callback.

References _AxisNumber, OIS::E_General, ff_device, OIS::JoyStick::MAX_AXIS, OIS::JoyStickState::mAxes, OIS::JoyStick::MIN_AXIS, mJoyStick, OIS::JoyStick::mSliders, OIS::JoyStick::mState, and OIS_EXCEPT.

Referenced by _enumerate().

BOOL CALLBACK Win32JoyStick::DIEnumEffectsCallback | ( | LPCDIEFFECTINFO | pdei,
|  | LPVOID | pvRef |
| ) |  |  | `[static, protected]`

Enumerate Force Feedback callback.

References OIS::Win32ForceFeedback::_addEffectSupport(), ff_device, and mJoyStick.

Referenced by _enumerate().

Interface * Win32JoyStick::queryInterface | ( | Interface::IType | type | ) | `[virtual]`

Remarks:
  If available, get an interface to write to some devices. Examples include, turning on and off LEDs, ForceFeedback, etc

Parameters:

  | type | The type of interface you are looking for

Implements OIS::Object.

References ff_device, and OIS::Interface::ForceFeedback.

void Win32JoyStick::setBuffered | ( | bool | buffered | ) | `[virtual]`

Remarks:
  Sets buffered mode

Implements OIS::Object.

References OIS::Object::mBuffered.

## Member Data Documentation

int OIS::Win32JoyStick::_AxisNumber`[protected]`

Mapping.

Referenced by _enumerate(), and DIEnumDeviceObjectsCallback().

DWORD OIS::Win32JoyStick::coopSetting`[protected]`

Referenced by _initialize(), and Win32JoyStick().

GUID OIS::Win32JoyStick::deviceGuid`[protected]`

Referenced by _initialize(), Win32JoyStick(), and ~Win32JoyStick().

Win32ForceFeedback* OIS::Win32JoyStick::ff_device`[protected]`

A force feedback device.

Referenced by _initialize(), DIEnumDeviceObjectsCallback(), DIEnumEffectsCallback(), queryInterface(), Win32JoyStick(), and ~Win32JoyStick().

IDirectInput8* OIS::Win32JoyStick::mDirectInput`[protected]`

Referenced by _initialize(), and Win32JoyStick().

IDirectInputDevice8* OIS::Win32JoyStick::mJoyStick`[protected]`

Referenced by _enumerate(), _initialize(), capture(), DIEnumDeviceObjectsCallback(), DIEnumEffectsCallback(), Win32JoyStick(), and ~Win32JoyStick().

The documentation for this class was generated from the following files:

- src/ois/win32/Win32JoyStick.h
- src/ois/win32/Win32JoyStick.cpp