* @brief Display the current average FPS over 1 sec */
| 1123 | * @brief Display the current average FPS over 1 sec |
| 1124 | */ |
| 1125 | static 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 |
no test coverage detected