Input.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef DEF_INPUT
  2. #define DEF_INPUT
  3. ///Jovian
  4. ///Adaptation pour InputAndJoy
  5. // Include
  6. #include <iostream>
  7. #include <SDL.h>
  8. #include <vector>
  9. // Classe
  10. class Input
  11. {
  12. public:
  13. Input();
  14. virtual ~Input();
  15. virtual void updateEvenements();
  16. bool terminer() const;
  17. void afficherPointeur(bool reponse) const;
  18. void capturerPointeur(bool reponse);
  19. bool getToucheHeld(const int touche) const;
  20. bool getBoutonSourisHeld(const Uint8 bouton) const;
  21. bool getToucheInstant(const int touche) const;
  22. bool getBoutonSourisInstant(const Uint8 bouton) const;
  23. bool mouvementSouris() const;
  24. int getX() const;
  25. int getY() const;
  26. int getXRel() const;
  27. int getYRel() const;
  28. void placerPtr(SDL_Surface* activWindow);
  29. int getWinHalfH();
  30. int getWinHalfW();
  31. protected:
  32. SDL_Event m_evenements;
  33. bool m_touchesHeld[SDLK_LAST];
  34. std::vector<int> m_touchesInstant;
  35. bool m_boutonsSourisHeld[8];
  36. std::vector<int> m_boutonsSourisInstant;
  37. int m_x;
  38. int m_y;
  39. int m_xRel;
  40. int m_yRel;
  41. bool m_terminer;
  42. bool m_relativeMouse;
  43. int m_windowHalfHeight;
  44. int m_windowHalfWidth;
  45. };
  46. #endif