40 ImGuiWindowFlags flags = ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoCollapse |
41 ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar;
44 ImVec2 histogram_size = ImVec2(60.f, 35.f);
49 std::string title =
fmt::format(
"FPS: {:5.1f}, Batch: {:5}, Tri: {:6}", stats.lastFPS, stats.batchCount, stats.triangleCount);
50 ImGui::SetCursorPosX((ImGui::GetWindowSize().
x - ImGui::CalcTextSize(title.c_str()).x) * 0.5f);
51 ImGui::Text(title.c_str());
55 std::string a =
"Current";
56 ImGui::SetCursorPosX((histogram_size.x + (3 * ImGui::GetStyle().ItemSpacing.x) + ImGui::GetStyle().FramePadding.x - ImGui::CalcTextSize(a.c_str()).x) * 0.5f);
57 ImGui::Text(
"%s",
_LC(
"SimPerfStats", a.c_str()));
60 std::string b =
"Average";
61 ImGui::SetCursorPosX((histogram_size.x * 3 + (5 * ImGui::GetStyle().ItemSpacing.x) + ImGui::GetStyle().FramePadding.x - ImGui::CalcTextSize(b.c_str()).x) * 0.5f);
62 ImGui::Text(
"%s",
_LC(
"SimPerfStats", b.c_str()));
65 std::string c =
"Worst";
66 ImGui::SetCursorPosX((histogram_size.x * 5 + (7 * ImGui::GetStyle().ItemSpacing.x) + ImGui::GetStyle().FramePadding.x - ImGui::CalcTextSize(c.c_str()).x) * 0.5f);
67 ImGui::Text(
"%s",
_LC(
"SimPerfStats", c.c_str()));
70 std::string d =
"Best";
71 ImGui::SetCursorPosX((histogram_size.x * 7 + (9 * ImGui::GetStyle().ItemSpacing.x) + ImGui::GetStyle().FramePadding.x - ImGui::CalcTextSize(d.c_str()).x) * 0.5f);
72 ImGui::Text(
"%s",
_LC(
"SimPerfStats", d.c_str()));
74 ImGui::PlotHistogram(
"", &stats.lastFPS, 1, 0, this->Convert(stats.lastFPS).c_str(), 0.f, stats.bestFPS, histogram_size);
76 ImGui::PlotHistogram(
"", &stats.avgFPS, 1, 0, this->Convert(stats.avgFPS).c_str(), 0.f, stats.bestFPS, histogram_size);
78 ImGui::PlotHistogram(
"", &stats.worstFPS, 1, 0, this->Convert(stats.worstFPS).c_str(), 0.f, stats.bestFPS, histogram_size);
80 ImGui::PlotHistogram(
"", &stats.bestFPS, 1, 0, this->Convert(stats.bestFPS).c_str(), 0.f, stats.bestFPS, histogram_size);
83 ImGui::PopStyleColor(1);
89 s << std::fixed << std::setprecision(2) << f;