mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 10:41:50 +00:00
Implement going to next/previous frame.
This commit is contained in:
parent
1cddf8436c
commit
785a30a68b
@ -338,7 +338,13 @@ bool View::DrawImpl()
|
|||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
if( ImGui::Button( "Compare" ) ) m_compare.show = true;
|
if( ImGui::Button( "Compare" ) ) m_compare.show = true;
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::Text( "Frames: %-7" PRIu64 " Time span: %-10s View span: %-10s Zones: %-13s Queue delay: %s Timer resolution: %s", m_worker.GetFrameCount(), TimeToString( m_worker.GetLastTime() - m_worker.GetFrameBegin( 0 ) ), TimeToString( m_zvEnd - m_zvStart ), RealToString( m_worker.GetZoneCount(), true ), TimeToString( m_worker.GetDelay() ), TimeToString( m_worker.GetResolution() ) );
|
if( ImGui::SmallButton( "<" ) ) ZoomToPrevFrame();
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::Text( "Frames: %" PRIu64, m_worker.GetFrameCount() );
|
||||||
|
ImGui::SameLine();
|
||||||
|
if( ImGui::SmallButton( ">" ) ) ZoomToNextFrame();
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGui::Text( "Time span: %-10s View span: %-10s Zones: %-13s Queue delay: %s Timer resolution: %s", TimeToString( m_worker.GetLastTime() - m_worker.GetFrameBegin( 0 ) ), TimeToString( m_zvEnd - m_zvStart ), RealToString( m_worker.GetZoneCount(), true ), TimeToString( m_worker.GetDelay() ), TimeToString( m_worker.GetResolution() ) );
|
||||||
DrawFrames();
|
DrawFrames();
|
||||||
DrawZones();
|
DrawZones();
|
||||||
ImGui::End();
|
ImGui::End();
|
||||||
@ -5294,6 +5300,41 @@ void View::ZoomToRange( int64_t start, int64_t end )
|
|||||||
m_zoomAnim.lenMod = 10.0 / log10( diff );
|
m_zoomAnim.lenMod = 10.0 / log10( diff );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void View::ZoomToPrevFrame()
|
||||||
|
{
|
||||||
|
if( m_zvStart >= m_worker.GetFrameBegin( 0 ) )
|
||||||
|
{
|
||||||
|
auto frame = m_worker.GetFrameRange( m_zvStart, m_zvStart ).first;
|
||||||
|
if( frame > 0 )
|
||||||
|
{
|
||||||
|
frame--;
|
||||||
|
const auto fbegin = m_worker.GetFrameBegin( frame );
|
||||||
|
const auto fend = m_worker.GetFrameEnd( frame );
|
||||||
|
ZoomToRange( fbegin, fend );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void View::ZoomToNextFrame()
|
||||||
|
{
|
||||||
|
int frame;
|
||||||
|
if( m_zvStart < m_worker.GetFrameBegin( 0 ) )
|
||||||
|
{
|
||||||
|
frame = -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
frame = m_worker.GetFrameRange( m_zvStart, m_zvStart ).first;
|
||||||
|
if( frame == -1 ) return;
|
||||||
|
}
|
||||||
|
frame++;
|
||||||
|
if( frame >= m_worker.GetFrameCount() ) return;
|
||||||
|
|
||||||
|
const auto fbegin = m_worker.GetFrameBegin( frame );
|
||||||
|
const auto fend = m_worker.GetFrameEnd( frame );
|
||||||
|
ZoomToRange( fbegin, fend );
|
||||||
|
}
|
||||||
|
|
||||||
void View::ShowZoneInfo( const ZoneEvent& ev )
|
void View::ShowZoneInfo( const ZoneEvent& ev )
|
||||||
{
|
{
|
||||||
if( m_zoneInfoWindow )
|
if( m_zoneInfoWindow )
|
||||||
|
@ -102,6 +102,8 @@ private:
|
|||||||
void ZoomToZone( const ZoneEvent& ev );
|
void ZoomToZone( const ZoneEvent& ev );
|
||||||
void ZoomToZone( const GpuEvent& ev );
|
void ZoomToZone( const GpuEvent& ev );
|
||||||
void ZoomToRange( int64_t start, int64_t end );
|
void ZoomToRange( int64_t start, int64_t end );
|
||||||
|
void ZoomToPrevFrame();
|
||||||
|
void ZoomToNextFrame();
|
||||||
|
|
||||||
void ShowZoneInfo( const ZoneEvent& ev );
|
void ShowZoneInfo( const ZoneEvent& ev );
|
||||||
void ShowZoneInfo( const GpuEvent& ev, uint64_t thread );
|
void ShowZoneInfo( const GpuEvent& ev, uint64_t thread );
|
||||||
|
Loading…
Reference in New Issue
Block a user