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 =
"FPS";
50 ImGui::SetCursorPosX((ImGui::GetWindowSize().
x - ImGui::CalcTextSize(title.c_str()).x) * 0.5f);
51 ImGui::Text(title.c_str());
53 std::string a =
"Current";
54 ImGui::SetCursorPosX((histogram_size.x + (3 * ImGui::GetStyle().ItemSpacing.x) + ImGui::GetStyle().FramePadding.x - ImGui::CalcTextSize(a.c_str()).x) * 0.5f);
55 ImGui::Text(
"%s",
_LC(
"SimPerfStats", a.c_str()));
58 std::string b =
"Average";
59 ImGui::SetCursorPosX((histogram_size.x * 3 + (5 * ImGui::GetStyle().ItemSpacing.x) + ImGui::GetStyle().FramePadding.x - ImGui::CalcTextSize(b.c_str()).x) * 0.5f);
60 ImGui::Text(
"%s",
_LC(
"SimPerfStats", b.c_str()));
63 std::string c =
"Worst";
64 ImGui::SetCursorPosX((histogram_size.x * 5 + (7 * ImGui::GetStyle().ItemSpacing.x) + ImGui::GetStyle().FramePadding.x - ImGui::CalcTextSize(c.c_str()).x) * 0.5f);
65 ImGui::Text(
"%s",
_LC(
"SimPerfStats", c.c_str()));
68 std::string d =
"Best";
69 ImGui::SetCursorPosX((histogram_size.x * 7 + (9 * ImGui::GetStyle().ItemSpacing.x) + ImGui::GetStyle().FramePadding.x - ImGui::CalcTextSize(d.c_str()).x) * 0.5f);
70 ImGui::Text(
"%s",
_LC(
"SimPerfStats", d.c_str()));
72 ImGui::PlotHistogram(
"", &stats.lastFPS, 1, 0, this->Convert(stats.lastFPS).c_str(), 0.f, stats.bestFPS, histogram_size);
74 ImGui::PlotHistogram(
"", &stats.avgFPS, 1, 0, this->Convert(stats.avgFPS).c_str(), 0.f, stats.bestFPS, histogram_size);
76 ImGui::PlotHistogram(
"", &stats.worstFPS, 1, 0, this->Convert(stats.worstFPS).c_str(), 0.f, stats.bestFPS, histogram_size);
78 ImGui::PlotHistogram(
"", &stats.bestFPS, 1, 0, this->Convert(stats.bestFPS).c_str(), 0.f, stats.bestFPS, histogram_size);
81 ImGui::Text(
"%s%zu",
_LC(
"SimPerfStats",
"Triangle count: "), stats.triangleCount);
82 ImGui::Text(
"%s%zu",
_LC(
"SimPerfStats",
"Batch count: "), stats.batchCount);
85 ImGui::PopStyleColor(1);
91 s << std::fixed << std::setprecision(2) << f;