diff --git a/ui-profiling.cc b/ui-profiling.cc index a29981d..5c4b67c 100644 --- a/ui-profiling.cc +++ b/ui-profiling.cc @@ -150,10 +150,8 @@ void T_Profiler::makeUI( ) ImGui::BeginChild( "left" , ImVec2( 180 , 0 ) , true ); float angle( 0 ); + displayed_.resize( n , true ); for ( auto i = 0u ; i < n ; i ++ ) { - if ( displayed_.size( ) == i ) { - displayed_.add( true ); - } angle = fmod( angle + 137 , 360 ); ImVec4 color( 0 , 0 , 0 , 1 ); ImGui::ColorConvertHSVtoRGB( angle / 360. , .5 , 1 , @@ -164,7 +162,7 @@ void T_Profiler::makeUI( ) char tms[ 12 ]; snprintf( tms , 12 , "%.1f" , secDurations_[ i ] ); sb << sections_[ i ] << " (" << tms << "ms)" << '\0'; - ImGui::Checkbox( sb.data( ) , (bool*) &displayed_[ i ] ); + ImGui::Checkbox( sb.data( ) , &displayed_[ i ] ); ImGui::PopStyleColor( ); if ( ImGui::IsItemHovered( ) ) { ImGui::BeginTooltip( ); diff --git a/ui-profiling.hh b/ui-profiling.hh index 38a345a..cd1f240 100644 --- a/ui-profiling.hh +++ b/ui-profiling.hh @@ -69,7 +69,7 @@ struct T_Profiler T_Array< float > secStarts_; bool uiEnabled_ = false; - T_Array< int > displayed_; + T_Array< bool > displayed_; T_Array< GLuint > gpuQueries_{ T_Array< GLuint >( 64 ) }; T_Data_ gpuSamples_;