1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Trace loading progress popup.

This commit is contained in:
Bartosz Taudul 2018-07-28 18:07:55 +02:00
parent 0bf0ceed3d
commit cd6e3ab2c9

View File

@ -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;