From cd6e3ab2c9bc73bdf034338604849024a3884061 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sat, 28 Jul 2018 18:07:55 +0200 Subject: [PATCH] Trace loading progress popup. --- standalone/src/main.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/standalone/src/main.cpp b/standalone/src/main.cpp index bafbae7c..f3d45b53 100644 --- a/standalone/src/main.cpp +++ b/standalone/src/main.cpp @@ -16,6 +16,7 @@ #include "../../server/TracyBadVersion.hpp" #include "../../server/TracyFileRead.hpp" #include "../../server/TracyView.hpp" +#include "../../server/TracyWorker.hpp" #include "Arimo.hpp" @@ -162,6 +163,23 @@ int main( int argc, char** argv ) view.reset(); } } + auto& progress = tracy::Worker::GetLoadProgress(); + auto totalProgress = progress.total.load( std::memory_order_relaxed ); + if( totalProgress != 0 ) + { + ImGui::OpenPopup( "Loading trace..." ); + } + if( ImGui::BeginPopupModal( "Loading trace..." ) ) + { + auto currProgress = progress.progress.load( std::memory_order_relaxed ); + if( totalProgress == 0 ) + { + ImGui::CloseCurrentPopup(); + totalProgress = currProgress; + } + ImGui::ProgressBar( float( currProgress ) / totalProgress, ImVec2( 200 * dpiScale, 0 ) ); + ImGui::EndPopup(); + } // Rendering int display_w, display_h;