mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 22:44:34 +00:00
Display memory usage also as a percentage.
This commit is contained in:
parent
2bf00b5eab
commit
dcddf8898b
@ -919,6 +919,19 @@ bool View::DrawImpl()
|
||||
ImGui::Text( "Profiler memory usage" );
|
||||
ImGui::EndTooltip();
|
||||
}
|
||||
if( m_totalMemory != 0 )
|
||||
{
|
||||
ImGui::SameLine();
|
||||
const auto memUse = float( memUsage ) / m_totalMemory * 100;
|
||||
if( memUse < 80 )
|
||||
{
|
||||
ImGui::TextDisabled( "(%.2f%%)", memUse );
|
||||
}
|
||||
else
|
||||
{
|
||||
ImGui::TextColored( ImVec4( 1.f, 0.25f, 0.25f, 1.f ), "(%.2f%%)", memUse );
|
||||
}
|
||||
}
|
||||
ImGui::SameLine();
|
||||
dx = ImGui::GetCursorPosX() - cx;
|
||||
if( dx < targetLabelSize ) ImGui::SameLine( cx + targetLabelSize );
|
||||
|
Loading…
Reference in New Issue
Block a user