NvGamepadXInput Class Reference

Class representing the XINPUT (Win32) implementation of gamepads. More...

#include <NvGamepadXInput.h>

Inheritance diagram for NvGamepadXInput:

NvGamepad

List of all members.

Public Member Functions

virtual bool getState (int32_t padID, State &state)
virtual uint32_t pollGamepads ()
 Calls the XINPUT polling functions to update the state of all gamepads.
virtual void setMaxGamepadCount (int32_t max)
 Sets the maximum number of simultaneous gamepads.
virtual int32_t getMaxGamepadCount ()
 Gets the maximum number of simultaneous gamepads.

Protected Member Functions

void updateFromXState (State &dest, const XINPUT_STATE &src)

Protected Attributes

State * mStates
XINPUT_STATE * mXStates


Detailed Description

Class representing the XINPUT (Win32) implementation of gamepads.

Class implementing gamepad support for the XINPUT (Win32) platform. This is mainly a "producer" class, used by an app framework or main loop implementation to regularly poll the XINPUT gamepads, so that an application can access it as the NvGamepad base class and read the gamepads. As a result, the only new function exposed by this subclass is pollGamepads, which calls into the XINPUT library to allow the class to update the gamepad state.


Member Function Documentation

virtual int32_t NvGamepadXInput::getMaxGamepadCount (  )  [virtual]

Gets the maximum number of simultaneous gamepads.

Returns:
the current maximum number of gamepads. Default is MAX_GAMEPADS

Implements NvGamepad.

virtual uint32_t NvGamepadXInput::pollGamepads (  )  [virtual]

Calls the XINPUT polling functions to update the state of all gamepads.

Used by the app framework or main loop to update the state of all gamepads Updates the internal representation of the state of all attached gamepads

Returns:
a mask of the changed gamepads. Bits 0-(MAX_GAMEPADS-1) will be 1 if the gamepad of that index (1<<index) has changed.

virtual void NvGamepadXInput::setMaxGamepadCount ( int32_t  max  )  [virtual]

Sets the maximum number of simultaneous gamepads.

Sets the maximum number of gamepads that the system should track For apps that will not support more than a fixed count of controllers, this could lower the expense of the library. This is purely a hint

Parameters:
[in] sets the maximum number of expected gamepads [1, MAX_GAMEPADS]

Implements NvGamepad.


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