Add animation to loading progress window.

This commit is contained in:
Bartosz Taudul 2019-03-06 02:49:21 +01:00
parent cee625b375
commit a4740c1b1c

View File

@ -221,6 +221,7 @@ int main( int argc, char** argv )
glfwShowWindow( window );
double time = 0;
// Main loop
while (!glfwWindowShouldClose(window))
{
@ -389,6 +390,18 @@ int main( int argc, char** argv )
if( ImGui::BeginPopupModal( "Loading trace...", nullptr, ImGuiWindowFlags_AlwaysAutoResize ) )
{
tracy::TextCentered( ICON_FA_HOURGLASS_HALF );
ImGui::TextUnformatted( "" );
auto draw = ImGui::GetWindowDrawList();
const auto wpos = ImGui::GetWindowPos();
const auto ty = ImGui::GetFontSize();
const auto h = ImGui::GetCursorPosY() - ty * 0.5f;
const auto w = ImGui::GetWindowWidth();
time += io.DeltaTime;
draw->AddCircleFilled( wpos + ImVec2( w * 0.5f - ty, h ), ty * ( 0.15f + 0.2f * ( pow( cos( time * 3.5f + 0.3f ), 16.f ) ) ), 0xFFBBBBBB, 12 );
draw->AddCircleFilled( wpos + ImVec2( w * 0.5f , h ), ty * ( 0.15f + 0.2f * ( pow( cos( time * 3.5f ), 16.f ) ) ), 0xFFBBBBBB, 12 );
draw->AddCircleFilled( wpos + ImVec2( w * 0.5f + ty, h ), ty * ( 0.15f + 0.2f * ( pow( cos( time * 3.5f - 0.3f ), 16.f ) ) ), 0xFFBBBBBB, 12 );
auto currProgress = progress.progress.load( std::memory_order_relaxed );
if( totalProgress == 0 )
{