NvGamepad Class Reference

Class representing the state of all gamepads. More...

#include <NvGamepad.h>

List of all members.

Classes

struct  State
 The state of a single gamepad. More...

Public Member Functions

virtual bool getState (int32_t padID, State &state)=0
 Get the state of a gamepad.
virtual void setMaxGamepadCount (int32_t max)=0
 Sets the maximum number of simultaneous gamepads.
virtual int32_t getMaxGamepadCount ()=0
 Gets the maximum number of simultaneous gamepads.
virtual bool isReady ()
 Whether there are gamepads ready to query, system is ready for use.
virtual uint32_t pollGamepads ()=0

Static Public Attributes

static const uint32_t BUTTON_DPAD_UP = 0x00000001
 Mask for DPAD up direction.
static const uint32_t BUTTON_DPAD_DOWN = 0x00000002
 Mask for DPAD down direction.
static const uint32_t BUTTON_DPAD_LEFT = 0x00000004
 Mask for DPAD left direction.
static const uint32_t BUTTON_DPAD_RIGHT = 0x00000008
 Mask for DPAD right direction.
static const uint32_t BUTTON_START = 0x00000010
 Mask for START button.
static const uint32_t BUTTON_BACK = 0x00000020
 Mask for BACK button.
static const uint32_t BUTTON_LEFT_THUMB = 0x00000040
 Mask for left thumbstick click.
static const uint32_t BUTTON_RIGHT_THUMB = 0x00000080
 Mask for right thumbstick click.
static const uint32_t BUTTON_LEFT_SHOULDER = 0x00000100
 Mask for left shoulder button (AKA L1).
static const uint32_t BUTTON_RIGHT_SHOULDER = 0x00000200
 Mask for right shoulder button (AKA R1).
static const uint32_t BUTTON_PLAY_PAUSE = 0x00000400
 Mask for a media play/pause button (AKA remotes).
static const uint32_t BUTTON_CENTER = 0x00000800
 Mask for center button (AKA X, NV, PS).
static const uint32_t BUTTON_A = 0x00001000
 Mask for A action button.
static const uint32_t BUTTON_B = 0x00002000
 Mask for B action button.
static const uint32_t BUTTON_X = 0x00004000
 Mask for X action button.
static const uint32_t BUTTON_Y = 0x00008000
 Mask for Y action button.
static const int32_t MAX_GAMEPADS = 4
 Max number of supported, simultaneous gamepads.


Detailed Description

Class representing the state of all gamepads.

Class representing the state of all attached gamepads, designed to be used by consumers of gamepad events. This represents the digital buttons and analog axes of multiple gamepads. This is an interface class. The platform will make a concrete instance of this available to the consumer through some method external to this API


Member Function Documentation

virtual int32_t NvGamepad::getMaxGamepadCount (  )  [pure virtual]

Gets the maximum number of simultaneous gamepads.

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

virtual bool NvGamepad::getState ( int32_t  padID,
State state 
) [pure 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

virtual bool NvGamepad::isReady (  )  [inline, virtual]

Whether there are gamepads ready to query, system is ready for use.

Returns:
true by default, subclasses may determine situations to return false.

virtual void NvGamepad::setMaxGamepadCount ( int32_t  max  )  [pure 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]


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