MCPcopy Create free account
hub / github.com/diasurgical/devilution / DrawFPS

Function DrawFPS

Source/scrollrt.cpp:1125–1143  ·  view source on GitHub ↗

* @brief Display the current average FPS over 1 sec */

Source from the content-addressed store, hash-verified

1123 * @brief Display the current average FPS over 1 sec
1124 */
1125static void DrawFPS()
1126{
1127 DWORD tc, frames;
1128 char String[12];
1129 HDC hdc;
1130
1131 if (frameflag && gbActive && pPanelText) {
1132 frameend++;
1133 tc = SDL_GetTicks();
1134 frames = tc - framestart;
1135 if (tc - framestart >= 1000) {
1136 framestart = tc;
1137 framerate = 1000 * frameend / frames;
1138 frameend = 0;
1139 }
1140 snprintf(String, 12, "%d FPS", framerate);
1141 PrintGameStr(8, 65, String, COL_RED);
1142 }
1143}
1144
1145/**
1146 * @brief Update part of the screen from the back buffer

Callers 1

DrawAndBlitFunction · 0.85

Calls 1

PrintGameStrFunction · 0.85

Tested by

no test coverage detected