Input.h 983 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef DEF_INPUT
  2. #define DEF_INPUT
  3. ///Jovian
  4. ///Adaptation pour CMake
  5. // Include
  6. #include <SDL.h>
  7. class Input
  8. {
  9. public:
  10. Input();
  11. ~Input();
  12. virtual void updateEvents();
  13. bool isFinished() const;
  14. void showCursor(bool reponse) const;
  15. void capPtr(bool reponse);
  16. bool getKey(const SDL_Scancode key) const;
  17. bool getMouseKey(const Uint8 key) const;
  18. bool isMouseMoving() const;
  19. int getX() const;
  20. int getY() const;
  21. int getXRel() const;
  22. int getYRel() const;
  23. void setWindow(SDL_Window* activWindow);
  24. int getMouseRelX() const;
  25. int getMouseRelY() const;
  26. protected:
  27. SDL_Event m_events;
  28. bool m_keys[SDL_NUM_SCANCODES];
  29. bool m_mouseKeys[8];
  30. int m_x;
  31. int m_y;
  32. int m_xRel;
  33. int m_yRel;
  34. bool m_finished;
  35. bool m_relativeMouse;
  36. SDL_Window* m_window;
  37. int m_windowHalfHeight;
  38. int m_windowHalfWidth;
  39. };
  40. #endif