diff options
author | Bartosz Taudul <wolf.pld@gmail.com> | 2019-03-06 20:12:44 +0300 |
---|---|---|
committer | Bartosz Taudul <wolf.pld@gmail.com> | 2019-03-06 20:16:21 +0300 |
commit | d5914d2e7b58198b2cac2c851fe84fa822d4036a (patch) | |
tree | fba20a8b52752cb833d93df87cab52e272e97907 /server/TracyImGui.hpp | |
parent | a4740c1b1cf1fbab0a1f21dc7981811d9a8f6aa8 (diff) |
Extract drawing waiting dots.
Diffstat (limited to 'server/TracyImGui.hpp')
-rw-r--r-- | server/TracyImGui.hpp | 13 |
1 files changed, 13 insertions, 0 deletions
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 |