1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-02 21:53: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
{
const auto offset = m_worker.GetFrameOffset();
if( sel == 0 )
if( m_frames->name == 0 )
{
ImGui::Text( "Tracy initialization" );
ImGui::Separator();
TextFocused( "Time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) );
}
else if( offset == 0 )
{
ImGui::TextDisabled( "Frame:" );
ImGui::SameLine();
ImGui::Text( "%s", RealToString( sel, true ) );
ImGui::Separator();
TextFocused( "Frame time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) );
}
else if( sel == 1 )
{
ImGui::Text( "Missed frames" );
ImGui::Separator();
TextFocused( "Time:", TimeToString( m_worker.GetFrameTime( *m_frames, 1 ) ) );
const auto offset = m_worker.GetFrameOffset();
if( sel == 0 )
{
ImGui::Text( "Tracy initialization" );
ImGui::Separator();
TextFocused( "Time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) );
}
else if( offset == 0 )
{
ImGui::TextDisabled( "Frame:" );
ImGui::SameLine();
ImGui::Text( "%s", RealToString( sel, true ) );
ImGui::Separator();
TextFocused( "Frame time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) );
}
else if( sel == 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
{
ImGui::TextDisabled( "Frame:" );
ImGui::TextDisabled( "%s:", m_worker.GetString( m_frames->name ) );
ImGui::SameLine();
ImGui::Text( "%s", RealToString( sel + offset - 1, true ) );
ImGui::Text( "%s", RealToString( sel, true ) );
ImGui::Separator();
TextFocused( "Frame time:", TimeToString( m_worker.GetFrameTime( *m_frames, sel ) ) );
}