[wpigui] Limit frame rate to 120 fps by default (#5030)

Limiting with vsync is apparently unreliable on a number of systems;
this resulted in high CPU/GPU usage.

Also add current actual frame rate to about dialog of GUI tools.
This commit is contained in:
Peter Johnson
2023-02-03 15:21:52 -08:00
committed by GitHub
parent 7867bbde0e
commit 193a10d020
7 changed files with 61 additions and 2 deletions

View File

@@ -269,6 +269,8 @@ int main(int argc, char** argv) {
ImGui::Text("v%s", GetWPILibVersion());
ImGui::Separator();
ImGui::Text("Save location: %s", glass::GetStorageDir().c_str());
ImGui::Text("%.3f ms/frame (%.1f FPS)",
1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
if (ImGui::Button("Close")) {
ImGui::CloseCurrentPopup();
}