Changeset 881

Show
Ignore:
Timestamp:
08/04/07 08:52:27 (1 year ago)
Author:
allenb
Message:

Change color of line in perf chart based on value. This makes performance spikes show up much more clearly.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/fcptr_stable_jun07/Source/System/Statistics/Foregrounds/OSGPerfMonitorForeground.cpp

    r880 r881  
    457457 
    458458         // Draw the data 
    459          glColor3f(1.0, 1.0, 0.0); 
     459         OSG::Color3f base_color(1.0, 1.0, 0.0); 
     460         OSG::Color3f high_color(1.0, 0.4, 0.0); 
     461         OSG::Color3f cur_color; 
    460462         std::vector<float>& norm_data(normalized_chart_data[i]); 
    461463         OSG_ASSERT(norm_data.size() == max_samples); 
     
    463465         glBegin(GL_LINE_STRIP);             
    464466            for (unsigned x=0;x<max_samples;++x) 
    465             {                
     467            { 
     468               float cur_val(norm_data[x]); 
     469               cur_color = (base_color*(1.0-cur_val)) + (high_color*cur_val); 
     470               glColor3fv(cur_color.getValuesRGB()); 
    466471               glVertex2f(float(x)*value_width, norm_data[x]*size); 
    467472            }