NvGamepadLinux Class Reference
Class representing the Linux implementation of gamepads. More...
#include <NvGamepadLinux.h>

Public Member Functions | |
NvGamepadLinux () | |
Opens up the joystick device for reading. | |
virtual | ~NvGamepadLinux () |
Closes the linux joystick device handle. | |
virtual uint32_t | pollGamepads () |
Attempts to read new data from joystick and convert into appropriate platform-independent tracking data. | |
virtual bool | getState (int32_t padID, State &state) |
Get the state of a gamepad. | |
virtual void | setMaxGamepadCount (int32_t max) |
Sets the maximum number of simultaneous gamepads. | |
virtual int32_t | getMaxGamepadCount () |
Gets the maximum number of simultaneous gamepads. | |
virtual bool | isReady () |
Whether there are gamepads ready to query, system is ready for use. |
Detailed Description
Class representing the Linux implementation of gamepads.Class implementing gamepad support for the Linux platform, using standard linux joystick /dev/input/jsX event device.
Member Function Documentation
virtual int32_t NvGamepadLinux::getMaxGamepadCount | ( | ) | [virtual] |
Gets the maximum number of simultaneous gamepads.
- Returns:
- the current maximum number of gamepads. Default is MAX_GAMEPADS
Implements NvGamepad.
virtual bool NvGamepadLinux::getState | ( | int32_t | padID, | |
State & | state | |||
) | [virtual] |
Get the state of a gamepad.
Queries the state of the desired gamepad, copying it into an application-supplied status structure
- Parameters:
-
[in] padID the index of the pad to read [0, MAX_GAMEPADS) [out] state the current state of the queried gamepad
- Returns:
- True on success, false if no pad connected at padID
- See also:
- State
Implements NvGamepad.
virtual bool NvGamepadLinux::isReady | ( | ) | [inline, virtual] |
Whether there are gamepads ready to query, system is ready for use.
- Returns:
- true if we have a valid gamepad opened.
Reimplemented from NvGamepad.
virtual uint32_t NvGamepadLinux::pollGamepads | ( | ) | [virtual] |
Attempts to read new data from joystick and convert into appropriate platform-independent tracking data.
Returns mask of gamepads with changed data.
virtual void NvGamepadLinux::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: