From 7526ac83b53c087e473751cf931c78e33c7a9f7c Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Tue, 3 Oct 2017 23:18:07 +0200 Subject: [PATCH] Display program name in profiler window title. --- server/TracyView.cpp | 6 +++++- server/TracyView.hpp | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/server/TracyView.cpp b/server/TracyView.cpp index 4be0f386..a056663a 100755 --- a/server/TracyView.cpp +++ b/server/TracyView.cpp @@ -198,6 +198,7 @@ void View::Worker() m_frames.push_back( welcome.timeBegin * m_timerMul ); m_delay = welcome.delay * m_timerMul; m_resolution = welcome.resolution * m_timerMul; + m_programName = welcome.programName; } m_hasData.store( true, std::memory_order_release ); @@ -740,8 +741,11 @@ void View::DrawImpl() DrawConnection(); } + char title[1024]; + sprintf( title, "%s###Profiler", m_programName.c_str() ); + std::lock_guard lock( m_lock ); - ImGui::Begin( "Profiler", nullptr, ImGuiWindowFlags_ShowBorders ); + ImGui::Begin( title, nullptr, ImGuiWindowFlags_ShowBorders ); if( ImGui::Button( m_pause ? "Resume" : "Pause", ImVec2( 80, 0 ) ) ) m_pause = !m_pause; ImGui::SameLine(); ImGui::Text( "Frames: %-7" PRIu64 " Time span: %-10s View span: %-10s Zones: %-10" PRIu64" Queue delay: %s Timer resolution: %s", m_frames.size(), TimeToString( GetLastTime() - m_frames[0] ), TimeToString( m_zvEnd - m_zvStart ), m_zonesCnt, TimeToString( m_delay ), TimeToString( m_resolution ) ); diff --git a/server/TracyView.hpp b/server/TracyView.hpp index 7b1519e3..c9b39118 100755 --- a/server/TracyView.hpp +++ b/server/TracyView.hpp @@ -152,6 +152,7 @@ private: uint64_t m_delay; uint64_t m_resolution; double m_timerMul; + std::string m_programName; int8_t m_lastCpu;