1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-03 14:03:52 +00:00

Proper frame names on frames graph.

This commit is contained in:
Bartosz Taudul 2018-08-04 21:46:26 +02:00
parent acabdf3c2a
commit 37f42a52fb

View File

@ -675,32 +675,43 @@ void View::DrawFrames()
} }
else else
{ {
const auto offset = m_worker.GetFrameOffset(); if( m_frames->name == 0 )
if( sel == 0 )
{ {
ImGui::Text( "Tracy initialization" ); const auto offset = m_worker.GetFrameOffset();
ImGui::Separator(); if( sel == 0 )
TextFocused( "Time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) ); {
} ImGui::Text( "Tracy initialization" );
else if( offset == 0 ) ImGui::Separator();
{ TextFocused( "Time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) );
ImGui::TextDisabled( "Frame:" ); }
ImGui::SameLine(); else if( offset == 0 )
ImGui::Text( "%s", RealToString( sel, true ) ); {
ImGui::Separator(); ImGui::TextDisabled( "Frame:" );
TextFocused( "Frame time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) ); ImGui::SameLine();
} ImGui::Text( "%s", RealToString( sel, true ) );
else if( sel == 1 ) ImGui::Separator();
{ TextFocused( "Frame time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) );
ImGui::Text( "Missed frames" ); }
ImGui::Separator(); else if( sel == 1 )
TextFocused( "Time:", TimeToString( m_worker.GetFrameTime( *m_frames, 1 ) ) ); {
ImGui::Text( "Missed frames" );
ImGui::Separator();
TextFocused( "Time:", TimeToString( m_worker.GetFrameTime( *m_frames, 1 ) ) );
}
else
{
ImGui::TextDisabled( "Frame:" );
ImGui::SameLine();
ImGui::Text( "%s", RealToString( sel + offset - 1, true ) );
ImGui::Separator();
TextFocused( "Frame time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) );
}
} }
else else
{ {
ImGui::TextDisabled( "Frame:" ); ImGui::TextDisabled( "%s:", m_worker.GetString( m_frames->name ) );
ImGui::SameLine(); ImGui::SameLine();
ImGui::Text( "%s", RealToString( sel + offset - 1, true ) ); ImGui::Text( "%s", RealToString( sel, true ) );
ImGui::Separator(); ImGui::Separator();
TextFocused( "Frame time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) ); TextFocused( "Frame time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) );
} }