Profiler - Some code clean-up

This commit is contained in:
Emmanuel BENOîT 2017-12-24 18:40:34 +01:00
parent 98ecedfaae
commit 020ba4a289
2 changed files with 3 additions and 5 deletions

View file

@ -150,10 +150,8 @@ void T_Profiler::makeUI( )
ImGui::BeginChild( "left" , ImVec2( 180 , 0 ) , true ); ImGui::BeginChild( "left" , ImVec2( 180 , 0 ) , true );
float angle( 0 ); float angle( 0 );
displayed_.resize( n , true );
for ( auto i = 0u ; i < n ; i ++ ) { for ( auto i = 0u ; i < n ; i ++ ) {
if ( displayed_.size( ) == i ) {
displayed_.add( true );
}
angle = fmod( angle + 137 , 360 ); angle = fmod( angle + 137 , 360 );
ImVec4 color( 0 , 0 , 0 , 1 ); ImVec4 color( 0 , 0 , 0 , 1 );
ImGui::ColorConvertHSVtoRGB( angle / 360. , .5 , 1 , ImGui::ColorConvertHSVtoRGB( angle / 360. , .5 , 1 ,
@ -164,7 +162,7 @@ void T_Profiler::makeUI( )
char tms[ 12 ]; char tms[ 12 ];
snprintf( tms , 12 , "%.1f" , secDurations_[ i ] ); snprintf( tms , 12 , "%.1f" , secDurations_[ i ] );
sb << sections_[ i ] << " (" << tms << "ms)" << '\0'; sb << sections_[ i ] << " (" << tms << "ms)" << '\0';
ImGui::Checkbox( sb.data( ) , (bool*) &displayed_[ i ] ); ImGui::Checkbox( sb.data( ) , &displayed_[ i ] );
ImGui::PopStyleColor( ); ImGui::PopStyleColor( );
if ( ImGui::IsItemHovered( ) ) { if ( ImGui::IsItemHovered( ) ) {
ImGui::BeginTooltip( ); ImGui::BeginTooltip( );

View file

@ -69,7 +69,7 @@ struct T_Profiler
T_Array< float > secStarts_; T_Array< float > secStarts_;
bool uiEnabled_ = false; bool uiEnabled_ = false;
T_Array< int > displayed_; T_Array< bool > displayed_;
T_Array< GLuint > gpuQueries_{ T_Array< GLuint >( 64 ) }; T_Array< GLuint > gpuQueries_{ T_Array< GLuint >( 64 ) };
T_Data_ gpuSamples_; T_Data_ gpuSamples_;