From ef317fa2be2aff6da3ed112c16e8aed4df4b9717 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 20 Sep 2017 22:34:56 +0200 Subject: [PATCH] Add frame time accessors. --- server/TracyView.cpp | 18 ++++++++++++++++++ server/TracyView.hpp | 2 ++ 2 files changed, 20 insertions(+) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 1a112171..1f7cba7c 100755 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -323,6 +323,24 @@ uint64_t View::GetFrameTime( size_t idx ) const } } +uint64_t View::GetFrameBegin( size_t idx ) const +{ + assert( idx < m_frames.size() ); + return m_frames[idx]; +} + +uint64_t View::GetFrameEnd( size_t idx ) const +{ + if( idx < m_frames.size() - 1 ) + { + return m_frames[idx+1]; + } + else + { + return GetLastTime(); + } +} + uint64_t View::GetLastTime() const { uint64_t last = 0; diff --git a/server/TracyView.hpp b/server/TracyView.hpp index bc498e33..c2105a6b 100755 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -49,6 +49,8 @@ private: void UpdateZone( Event* zone ); uint64_t GetFrameTime( size_t idx ) const; + uint64_t GetFrameBegin( size_t idx ) const; + uint64_t GetFrameEnd( size_t idx ) const; uint64_t GetLastTime() const; const char* TimeToString( uint64_t ns ) const;