inputManager.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef INPUTMANAGER_H
  2. #define INPUTMANAGER_H
  3. // ===============================
  4. // AUTHOR : Angel Ortiz (angelo12 AT vt DOT edu)
  5. // CREATE DATE : 2018-07-02
  6. // PURPOSE : Managing user input either via keyboard, mouse movement, clicking, or
  7. // even mouse wheel. It's currently mostly used for camera traversal,
  8. // scene switching and exiting the program.
  9. // ===============================
  10. // SPECIAL NOTES: It works by directly calling functions that perform these actions,
  11. // that is it doesn't tell the camera to move by x amount on the next update cycle.
  12. // The input manager goes ahead and does just that. And withing the update calls of each
  13. // object that is affected it deals with the consequences of performing that action.
  14. // ===============================
  15. //Headers
  16. #include "sceneManager.h"
  17. #include "camera.h"
  18. #include "SDL.h"
  19. class InputManager{
  20. public:
  21. //Dummy constructors / Destructors
  22. //Not really necessary here, but follows the same format for consistency
  23. InputManager();
  24. ~InputManager();
  25. bool startUp(SceneManager &sceneManager);
  26. void shutDown();
  27. //Processes all the SDL events that have ocurred in the past frame
  28. void processInput(bool &done, unsigned int deltaT);
  29. private:
  30. SceneManager *sceneController;
  31. Camera *sceneCamera;
  32. //Where specific events are handled
  33. void handleEvent(SDL_Event * event, bool &done, unsigned int deltaT);
  34. };
  35. #endif