TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | List of all members
iGameCtrl Struct Referenceabstract
Inheritance diagram for iGameCtrl:
iUnknown

Detailed Description

Game controller interface. {DispatchWrapper}.

Public Member Functions

virtual tBool Update ()=0
 Update the device states. More...
 
virtual tBool GetIsConnected () const =0
 Return eTrue if the device is connected. {Property}. More...
 
virtual const acharGetName () const =0
 Name of the input device. {Property}. More...
 
virtual tU32 GetIndex () const =0
 Get the index of the game controller. {Property}. More...
 
virtual tU32 GetNumButtons () const =0
 Return the number of buttons of the game controller. {Property}. More...
 
virtual tF32 GetButton (tU32 ulButton)=0
 Return the force applied on the button. {Property}. More...
 
virtual tU32 GetNumAxis () const =0
 Return the number of axis of the game controller. {Property}. More...
 
virtual tF32 GetAxis (eGameCtrlAxis axis)=0
 Return the position of the given axis {Property}. More...
 
virtual tBool GetCanVibrate () const =0
 Get whether the game controller can vibrate. {Property}. More...
 
virtual void Vibrate (const sVec2f &aSpeed)=0
 Set the left & right motor vibrations. More...
 
virtual tBool GetHasBattery () const =0
 Get whether the controller has a battery. {Property}. More...
 
virtual tF32 GetBatteryLevel () const =0
 Get the battery level. {Property}. More...
 
- Public Member Functions inherited from iUnknown
virtual tBool IsOK () const =0
 Check if the object is valid. More...
 
virtual tI32 AddRef ()=0
 Signal that one more reference of the object has been created. More...
 
virtual tI32 Release ()=0
 Release a reference of the object. More...
 
virtual void DeleteThis ()=0
 Bypass any reference counting and delete this object. More...
 
virtual void Invalidate ()=0
 Invalidate the object. More...
 
virtual iUnknownQueryInterface (const tUUID &aIID)=0
 Query an interface. More...
 
virtual void ListInterfaces (iMutableCollection *apLst, tU32 anFlags) const =0
 Fill a UUID list containing the UUIDs of the implemented interfaces. More...
 
virtual tI32 SetNumRefs (tI32 anNumRefs)=0
 Set the reference counter directly. More...
 
virtual tI32 GetNumRefs () const =0
 Get the number of references to this object. More...
 

Member Function Documentation

virtual tBool Update ( )
pure virtual

Update the device states.

Remarks
All the get methods depends on Update being called first to get the latest value as most game controllers are polled and not event based.
Return true if any state changed since the last update, eFalse otherwise.
virtual tBool GetIsConnected ( ) const
pure virtual

Return eTrue if the device is connected. {Property}.

virtual const achar* GetName ( ) const
pure virtual

Name of the input device. {Property}.

virtual tU32 GetIndex ( ) const
pure virtual

Get the index of the game controller. {Property}.

virtual tU32 GetNumButtons ( ) const
pure virtual

Return the number of buttons of the game controller. {Property}.

virtual tF32 GetButton ( tU32  ulButton)
pure virtual

Return the force applied on the button. {Property}.

virtual tU32 GetNumAxis ( ) const
pure virtual

Return the number of axis of the game controller. {Property}.

virtual tF32 GetAxis ( eGameCtrlAxis  axis)
pure virtual

Return the position of the given axis {Property}.

virtual tBool GetCanVibrate ( ) const
pure virtual

Get whether the game controller can vibrate. {Property}.

virtual void Vibrate ( const sVec2f aSpeed)
pure virtual

Set the left & right motor vibrations.

virtual tBool GetHasBattery ( ) const
pure virtual

Get whether the controller has a battery. {Property}.

virtual tF32 GetBatteryLevel ( ) const
pure virtual

Get the battery level. {Property}.

Remarks
0 is empty, 1.0 is full.