Changeset 2817 for code/branches/gui/src/orxonox/Game.h
- Timestamp:
- Mar 21, 2009, 10:17:59 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/orxonox/Game.h
r2807 r2817 38 38 #include "OrxonoxPrereqs.h" 39 39 #include <cassert> 40 #include "core/CorePrereqs.h" 40 #include <list> 41 #include "core/OrxonoxClass.h" 41 42 42 43 namespace orxonox … … 46 47 Main class responsible for running the game. 47 48 */ 48 class _OrxonoxExport Game 49 class _OrxonoxExport Game : public OrxonoxClass 49 50 { 50 51 public: 51 52 Game(int argc, char** argv); 52 53 ~Game(); 54 void setConfigValues(); 53 55 54 56 void run(); 55 57 void stop(); 56 58 59 float getAvgTickTime() { return this->avgTickTime_; } 60 float getAvgFPS() { return this->avgFPS_; } 61 62 void addTickTime(uint32_t length); 63 57 64 static Game& getInstance() { assert(singletonRef_s); return *singletonRef_s; } 58 65 59 66 private: 67 struct statisticsTickInfo 68 { 69 uint64_t tickTime; 70 uint32_t tickLength; 71 }; 72 60 73 Game(Game&); // don't mess with singletons 61 74 … … 65 78 bool abort_; 66 79 80 // variables for time statistics 81 uint64_t statisticsStartTime_; 82 std::list<statisticsTickInfo> 83 statisticsTickTimes_; 84 uint32_t periodTime_; 85 uint32_t periodTickTime_; 86 float avgFPS_; 87 float avgTickTime_; 88 89 // config values 90 unsigned int statisticsRefreshCycle_; 91 unsigned int statisticsAvgLength_; 92 67 93 static Game* singletonRef_s; //!< Pointer to the Singleton 68 94 };
Note: See TracChangeset
for help on using the changeset viewer.