Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Taudul <wolf.pld@gmail.com>2018-08-18 00:07:58 +0300
committerBartosz Taudul <wolf.pld@gmail.com>2018-08-18 00:07:58 +0300
commite1e0e6e1403368a166db7644fe3ca0de166fd6d6 (patch)
tree13afd04ba4579ec796653f9b41c9a1e88b10ed12 /server/TracyImGui.hpp
parent4c393a2b8d45ccabad3b6b4776a8d689bdcb6497 (diff)
Centered text helper.
Diffstat (limited to 'server/TracyImGui.hpp')
-rw-r--r--server/TracyImGui.hpp12
1 files changed, 12 insertions, 0 deletions
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