diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp index 3c2d2533..396ff388 100644 --- a/profiler/src/main.cpp +++ b/profiler/src/main.cpp @@ -391,16 +391,8 @@ int main( int argc, char** argv ) { 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 ); + tracy::DrawWaitingDots( time ); auto currProgress = progress.progress.load( std::memory_order_relaxed ); if( totalProgress == 0 ) diff --git a/server/TracyImGui.hpp b/server/TracyImGui.hpp index 385e9155..41f42df2 100644 --- a/server/TracyImGui.hpp +++ b/server/TracyImGui.hpp @@ -19,6 +19,19 @@ namespace tracy ImGui::Text( "%s", text ); } + static inline void DrawWaitingDots( double time ) + { + 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(); + 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 ); + } + } #endif