MCPcopy Create free account
hub / github.com/SpartanJ/eepp / mainLoop

Method mainLoop

src/tools/ecode/ecode.cpp:1004–1032  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1002}
1003
1004void App::mainLoop() {
1005 mWindow->getInput()->update();
1006 SceneManager::instance()->update();
1007
1008 if ( unlikely( firstUpdate ) ) {
1009 Log::info( "First update took: %.2f ms", globalClock.getElapsedTime().asMilliseconds() );
1010 firstUpdate = false;
1011 }
1012
1013 if ( SceneManager::instance()->getUISceneNode()->invalidated() || mBenchmarkMode ) {
1014 mWindow->clear();
1015 SceneManager::instance()->draw();
1016 mWindow->display();
1017 if ( unlikely( firstFrame ) ) {
1018 Log::info( "First frame took: %.2f ms", globalClock.getElapsedTime().asMilliseconds() );
1019 firstFrame = false;
1020 onReady();
1021 }
1022 } else {
1023#if EE_PLATFORM != EE_PLATFORM_EMSCRIPTEN
1024 mWindow->getInput()->waitEvent( Milliseconds( mWindow->hasFocus() ? 16 : 100 ) );
1025#endif
1026 }
1027
1028 if ( mBenchmarkMode && mSecondsCounter.getElapsedTime() >= Seconds( 1 ) ) {
1029 setAppTitle( mWindowTitle );
1030 mSecondsCounter.restart();
1031 }
1032}
1033
1034void App::onFileDropped( std::string file, bool openBinaryAsDocument ) {
1035 Vector2f mousePos( mUISceneNode->getEventDispatcher()->getMousePosf() );

Callers 1

appLoopFunction · 0.45

Calls 15

infoFunction · 0.85
MillisecondsFunction · 0.85
SecondsFunction · 0.85
asMillisecondsMethod · 0.80
getElapsedTimeMethod · 0.80
displayMethod · 0.80
waitEventMethod · 0.80
updateMethod · 0.45
getInputMethod · 0.45
invalidatedMethod · 0.45
getUISceneNodeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected