InputAndJoy.h 918 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef INPUTANDJOY_H_INCLUDED
  2. #define INPUTANDJOY_H_INCLUDED
  3. ///Jovian
  4. ///Adaptation pour InputAndJoy
  5. // Include
  6. #include <SDL2/SDL.h>
  7. #include <iostream>
  8. #include <vector>
  9. #include "Input.h"
  10. //Enum
  11. #define CLAVIER_SOURIS 1
  12. #define MANETTE 2
  13. // Classe
  14. class InputAndJoy : public Input
  15. {
  16. public:
  17. InputAndJoy();
  18. ~InputAndJoy();
  19. virtual void updateEvenements();
  20. int getAxeValue(const Uint8 axeID) const;
  21. bool getBoutonPad(const Uint8 bouton) const;
  22. void setMainControleur(int type);
  23. virtual float getMainXRel() const;
  24. virtual float getMainYRel() const;
  25. virtual float getMainXMove() const;
  26. virtual float getMainYMove() const;
  27. private:
  28. SDL_Joystick* m_manette;
  29. int m_nbAxes;
  30. int m_nbBoutons;
  31. int m_controleurType;
  32. int const m_seuil;
  33. std::vector<int> m_axeValue;
  34. std::vector<bool> m_boutonValue;
  35. };
  36. #endif // INPUTANDJOY_H_INCLUDED