sceneManager.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef SCENEMANAGER_H
  2. #define SCENEMANAGER_H
  3. // ===============================
  4. // AUTHOR : Angel Ortiz (angelo12 AT vt DOT edu)
  5. // CREATE DATE : 2018-07-10
  6. // PURPOSE : Managing the switching of scenes, loading unloading etc, and updating
  7. // the current scene. It also returns the currently loaded scene to any
  8. // other manager system that wants that information.
  9. // ===============================
  10. // SPECIAL NOTES: The reason I believe you need a scene manager class and not have the
  11. // the scenes do all of this themselves is that I don't want to have to update all
  12. // pointers to the scene every time that changes. Instead you just point to the scenemanager
  13. // and that keeps track of the scene itself.
  14. // ===============================
  15. //Headers
  16. #include "scene.h"
  17. class SceneManager{
  18. public:
  19. //Dummy Constructor / Destructor
  20. SceneManager();
  21. ~SceneManager();
  22. //Initializes and closes all scene related stuff
  23. bool startUp();
  24. void shutDown();
  25. // Scene switching
  26. bool switchScene(std::string sceneID);
  27. // Update current scene
  28. void update(unsigned int deltaT);
  29. //Called by the rendermanager to prep the render queue
  30. //Also called by the input manager as a precaution to avoid dangling pointers
  31. Scene* getCurrentScene();
  32. private:
  33. bool loadScene(std::string sceneID);
  34. //String could probably be an enum instead, but it's easier this way to build
  35. //the relative paths if it is a string.
  36. std::string currentSceneID;
  37. Scene* currentScene;
  38. };
  39. #endif