MCPcopy Create free account
hub / github.com/cinder/Cinder / privateUpdate__

Method privateUpdate__

src/cinder/app/AppBase.cpp:227–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227void AppBase::privateUpdate__()
228{
229 mFrameCount++;
230
231 // service asio::io_context
232 mIo->poll();
233
234 if( getNumWindows() > 0 ) {
235 WindowRef mainWin = getWindowIndex( 0 );
236 if( mainWin )
237 mainWin->getRenderer()->makeCurrentContext();
238 }
239
240 mSignalUpdate.emit();
241
242 update();
243
244 mTimeline->stepTo( static_cast<float>( getElapsedSeconds() ) );
245
246 double now = mTimer.getSeconds();
247 if( now > mFpsLastSampleTime + mFpsSampleInterval ) {
248 //calculate average Fps over sample interval
249 uint32_t framesPassed = mFrameCount - mFpsLastSampleFrame;
250 mAverageFps = (float)(framesPassed / (now - mFpsLastSampleTime));
251
252 mFpsLastSampleTime = now;
253 mFpsLastSampleFrame = mFrameCount;
254 }
255}
256
257void AppBase::emitCleanup()
258{

Callers 5

eventHandlerMethod · 0.80
runMethod · 0.80
updateAndDrawMethod · 0.80
runMethod · 0.80
runMethod · 0.80

Calls 9

getNumWindowsFunction · 0.85
getWindowIndexFunction · 0.85
emitMethod · 0.80
getSecondsMethod · 0.80
updateFunction · 0.50
getElapsedSecondsFunction · 0.50
makeCurrentContextMethod · 0.45
getRendererMethod · 0.45
stepToMethod · 0.45

Tested by

no test coverage detected