Update the GUI
| 129 | |
| 130 | // Update the GUI |
| 131 | void Gui::update() { |
| 132 | |
| 133 | // Update Profiling GUI every seconds |
| 134 | if ((mApp->mCurrentTime - mTimeSinceLastProfilingDisplay) > TIME_INTERVAL_DISPLAY_PROFILING_INFO) { |
| 135 | mTimeSinceLastProfilingDisplay = mApp->mCurrentTime; |
| 136 | mCachedFPS = mApp->mFPS; |
| 137 | mCachedUpdateTime = mApp->mFrameTime; |
| 138 | mCachedTotalPhysicsUpdateTime = mApp->mTotalPhysicsTime; |
| 139 | mCachedPhysicsStepTime = mApp->mPhysicsStepTime; |
| 140 | } |
| 141 | |
| 142 | // Framerate (FPS) |
| 143 | mFPSLabel->set_caption(std::string("FPS : ") + floatToString(mCachedFPS, 0)); |
| 144 | |
| 145 | // Frame time |
| 146 | mFrameTimeLabel->set_caption(std::string("Frame time : ") + floatToString(mCachedUpdateTime * 1000.0, 1) + std::string(" ms")); |
| 147 | |
| 148 | // Total Physics time |
| 149 | mTotalPhysicsTimeLabel->set_caption(std::string("Total physics time : ") + floatToString(mCachedTotalPhysicsUpdateTime * 1000.0, 1) + std::string(" ms")); |
| 150 | |
| 151 | // Physics step time |
| 152 | mPhysicsStepTimeLabel->set_caption(std::string("Physics step time : ") + floatToString(mCachedPhysicsStepTime * 1000.0, 1) + std::string(" ms")); |
| 153 | } |
| 154 | |
| 155 | void Gui::createSimulationPanel() { |
| 156 |