diff options
Diffstat (limited to 'source/gameengine/GameLogic/Joystick/SCA_Joystick.h')
-rw-r--r-- | source/gameengine/GameLogic/Joystick/SCA_Joystick.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h index 2d2a713fe00..997e76615d3 100644 --- a/source/gameengine/GameLogic/Joystick/SCA_Joystick.h +++ b/source/gameengine/GameLogic/Joystick/SCA_Joystick.h @@ -71,12 +71,16 @@ /* * Basic Joystick class - + * I will make this class a singleton because there should be only one joystick + * even if there are more than one scene using it and count how many scene are using it. + * The underlying joystick should only be removed when the last scene is removed */ class SCA_Joystick { + static SCA_Joystick *m_instance; + static int m_refCount; class PrivateData; @@ -258,20 +262,22 @@ class SCA_Joystick int pGetHat(int direction); - - -public: - SCA_Joystick(); ~SCA_Joystick(); - - bool CreateJoystickDevice(void); void DestroyJoystickDevice(void); + +public: + + static SCA_Joystick *GetInstance(); + + void ReleaseInstance(); + + void HandleEvents(); /* |