Display durations in profiler list

This commit is contained in:
Emmanuel BENOîT 2017-10-05 08:32:43 +02:00
parent 5306ce4535
commit 93308ac578

View file

@ -123,7 +123,7 @@ void T_Profiler::makeUI( )
ImGuiSetCond_Once ); ImGuiSetCond_Once );
ImGui::Begin( "Profiler" ); ImGui::Begin( "Profiler" );
ImGui::BeginChild( "left" , ImVec2( 150 , 0 ) , true ); ImGui::BeginChild( "left" , ImVec2( 180 , 0 ) , true );
float angle( 0 ); float angle( 0 );
for ( auto i = 0u ; i < n ; i ++ ) { for ( auto i = 0u ; i < n ; i ++ ) {
if ( displayed_.size( ) == i ) { if ( displayed_.size( ) == i ) {
@ -134,8 +134,12 @@ void T_Profiler::makeUI( )
ImGui::ColorConvertHSVtoRGB( angle / 360. , .5 , 1 , ImGui::ColorConvertHSVtoRGB( angle / 360. , .5 , 1 ,
color.x , color.y , color.z ); color.x , color.y , color.z );
ImGui::PushStyleColor( ImGuiCol_Text , color ); ImGui::PushStyleColor( ImGuiCol_Text , color );
ImGui::Checkbox( sections_[ i ].c_str( ) ,
(bool*) &displayed_[ i ] ); std::ostringstream str;
str << sections_[ i ] << " ("
<< int( round( secDurations_[ i ] ) )
<< "ms)";
ImGui::Checkbox( str.str( ).c_str( ) , (bool*) &displayed_[ i ] );
ImGui::PopStyleColor( ); ImGui::PopStyleColor( );
} }
ImGui::EndChild( ); ImGui::EndChild( );