Display program name in profiler window title.

This commit is contained in:
Bartosz Taudul 2017-10-03 23:18:07 +02:00
parent cf07383db8
commit 7526ac83b5
2 changed files with 6 additions and 1 deletions

View File

@ -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<std::mutex> 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 ) );

View File

@ -152,6 +152,7 @@ private:
uint64_t m_delay;
uint64_t m_resolution;
double m_timerMul;
std::string m_programName;
int8_t m_lastCpu;