Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef __InputHandler__
- #define __InputHandler__
- #include <iostream>
- #include <vector>
- #include <SDL2/SDL.h>
- class InputHandler
- {
- public:
- static InputHandler* Instance()
- {
- if(s_pInstance == 0)
- {
- s_pInstance = new InputHandler();
- }
- return s_pInstance;
- }
- void update();
- void clean();
- void initialiseJoysticks();
- bool joystickInitialised() {
- return m_bjoysticksInitialised; }
- int xvalue(int joy, int stick);
- int yvalue(int joy, int stick);
- private:
- InputHandler() {}
- static InputHandler* s_pInstance;
- std::vector<SDL_Joystick*> m_joysticks;
- bool m_bjoysticksInitialised;
- const int m_joystickDeadZone = 10000;
- };
- typedef InputHandler TheInputHandler;
- #endif /*defined (InputHandler) */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement