Input.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef DEF_INPUT
  2. #define DEF_INPUT
  3. ///Jovian
  4. ///Adaptation pour InputAndJoy
  5. // Include
  6. #include <SDL2/SDL.h>
  7. // Classe
  8. class Input
  9. {
  10. public:
  11. Input();
  12. ~Input();
  13. virtual void updateEvenements();
  14. bool terminer() const;
  15. void afficherPointeur(bool reponse) const;
  16. void capturerPointeur(bool reponse);
  17. bool getTouche(const SDL_Scancode touche) const;
  18. bool getBoutonSouris(const Uint8 bouton) const;
  19. bool mouvementSouris() const;
  20. int getX() const;
  21. int getY() const;
  22. int getXRel() const;
  23. int getYRel() const;
  24. void setWindow(SDL_Window* activWindow);
  25. void setMoveKeys(SDL_Scancode avancer, SDL_Scancode reculer, SDL_Scancode droite, SDL_Scancode gauche);
  26. virtual float getMainXRel() const;
  27. virtual float getMainYRel() const;
  28. virtual float getMainXMove() const;
  29. virtual float getMainYMove() const;
  30. protected:
  31. SDL_Event m_evenements;
  32. bool m_touches[SDL_NUM_SCANCODES];
  33. bool m_boutonsSouris[8];
  34. int m_x;
  35. int m_y;
  36. int m_xRel;
  37. int m_yRel;
  38. SDL_Scancode m_avancer;
  39. SDL_Scancode m_reculer;
  40. SDL_Scancode m_droite;
  41. SDL_Scancode m_gauche;
  42. bool m_terminer;
  43. bool m_relativeMouse;
  44. SDL_Window* m_window;
  45. int m_windowHalfHeight;
  46. int m_windowHalfWidth;
  47. };
  48. #endif