diff --git a/server/TracyImGui.hpp b/server/TracyImGui.hpp index 2d486185..703eb905 100644 --- a/server/TracyImGui.hpp +++ b/server/TracyImGui.hpp @@ -9,4 +9,16 @@ static inline ImVec2 operator+( const ImVec2& l, const ImVec2& r ) { return ImVe static inline ImVec2 operator-( const ImVec2& l, const ImVec2& r ) { return ImVec2( l.x - r.x, l.y - r.y ); } #endif +namespace tracy +{ + + static inline void TextCentered( const char* text ) + { + const auto tw = ImGui::CalcTextSize( text ).x; + ImGui::SetCursorPosX( ( ImGui::GetWindowWidth() - tw ) * 0.5f ); + ImGui::Text( text ); + } + +} + #endif