MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / DrawProfileTab

Function DrawProfileTab

engine/Poseidon/Dev/Debug/DebugOverlay.cpp:871–896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

869}
870} // namespace
871
872void DrawProfileTab()
873{
874 ProfileSample(); // pump every draw
875
876 ImGui::TextUnformatted("Frame stats");
877 ImGui::Separator();
878
879 const float fps = ProfileFps();
880 const float ms = ProfileFrameMs();
881 ImGui::Text("FPS: %.1f", fps);
882 ImGui::Text("Frame: %.2f ms", ms);
883
884 // Frame-time plot. PlotLines is fine for ring-buffered floats;
885 // ImGui handles the visual stride. Y-axis fixed 0..50 ms (~20fps
886 // floor) so spikes are visible without auto-rescaling jitter.
887 ImGui::Separator();
888 ImGui::PlotLines("##frame_ms", s_frameMs, kProfHistory, s_frameMsHead, "frame ms (last 240)", 0.0f, 50.0f,
889 ImVec2(0, 80));
890
891 if (ImGui::Button("Reset history"))
892 {
893 for (int i = 0; i < kProfHistory; i++)
894 s_frameMs[i] = 0.0f;
895 s_frameMsHead = 0;
896 }
897}
898
899// Memory tab — live MemoryUsed() value + peak tracker + history plot.

Callers 1

DrawMainWindowFunction · 0.85

Calls 3

ProfileSampleFunction · 0.85
ProfileFpsFunction · 0.85
ProfileFrameMsFunction · 0.85

Tested by

no test coverage detected