Open Source Tomb Raider Engine
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

RunTime.h 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*!
  2. * \file include/RunTime.h
  3. * \brief run time configuration storage
  4. *
  5. * \author xythobuz
  6. */
  7. #ifndef _RUNTIME_H_
  8. #define _RUNTIME_H_
  9. #include <string>
  10. #include <vector>
  11. /*!
  12. * \brief Main Game Singleton
  13. */
  14. class RunTime {
  15. public:
  16. RunTime();
  17. std::string getBaseDir();
  18. void setBaseDir(std::string dir);
  19. std::string getPakDir();
  20. void setPakDir(std::string dir);
  21. std::string getAudioDir();
  22. void setAudioDir(std::string dir);
  23. std::string getDataDir();
  24. void setDataDir(std::string dir);
  25. KeyboardButton getKeyBinding(ActionEvents event);
  26. void setKeyBinding(ActionEvents event, KeyboardButton button);
  27. bool isRunning();
  28. void setRunning(bool run);
  29. bool getShowFPS();
  30. void setShowFPS(bool fps);
  31. void updateFPS();
  32. unsigned long getFPS();
  33. const std::vector<float>& getHistoryFPS();
  34. float getLastFrameTime();
  35. private:
  36. std::string baseDir;
  37. std::string pakDir;
  38. std::string audioDir;
  39. std::string dataDir;
  40. KeyboardButton keyBindings[ActionEventCount];
  41. bool gameIsRunning;
  42. bool showFPS;
  43. unsigned long lastTime, lastFrameTime;
  44. unsigned long frameCount, frameCount2;
  45. unsigned long frameTimeSum, frameTimeSum2;
  46. unsigned long fps;
  47. std::vector<float> history;
  48. };
  49. RunTime& getRunTime();
  50. #endif