MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / update

Method update

testbed/src/Gui.cpp:131–153  ·  view source on GitHub ↗

Update the GUI

Source from the content-addressed store, hash-verified

129
130// Update the GUI
131void 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
155void Gui::createSimulationPanel() {
156

Callers 1

mainFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected