MCPcopy Create free account
hub / github.com/Aloshi/EmulationStation / update

Method update

src/Window.cpp:95–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95void Window::update(int deltaTime)
96{
97 if(mNormalizeNextUpdate)
98 {
99 mNormalizeNextUpdate = false;
100 if(deltaTime > mAverageDeltaTime)
101 deltaTime = mAverageDeltaTime;
102 }
103
104 mFrameTimeElapsed += deltaTime;
105 mFrameCountElapsed++;
106 if(mFrameTimeElapsed > 500)
107 {
108 mAverageDeltaTime = mFrameTimeElapsed / mFrameCountElapsed;
109
110 if(Settings::getInstance()->getBool("DRAWFRAMERATE"))
111 {
112 std::stringstream ss;
113 ss << std::fixed << std::setprecision(1) << (1000.0f * (float)mFrameCountElapsed / (float)mFrameTimeElapsed) << "fps, ";
114 ss << std::fixed << std::setprecision(2) << ((float)mFrameTimeElapsed / (float)mFrameCountElapsed) << "ms";
115 mFrameDataString = ss.str();
116 }
117
118 mFrameTimeElapsed = 0;
119 mFrameCountElapsed = 0;
120 }
121
122 if(peekGui())
123 peekGui()->update(deltaTime);
124}
125
126void Window::render()
127{

Callers 1

mainFunction · 0.45

Calls 1

getBoolMethod · 0.80

Tested by

no test coverage detected