38 for(
size_t ui=0;ui<length;ui++)
40 cerr <<
"|" << endl <<
"|";
64 delta = progress-lastProg;
67 float ticks = ((float)delta*(
float)length/100.0f);
68 accumulatedTicks+=ticks;
70 if(accumulatedTicks >=1.0f)
73 delta=accumulatedTicks;
74 accumulatedTicks-=delta;
82 cerr <<
"| Done." << endl;
88 bool testProgressBar()
void finish()
Finalise the progress bar. It is not necessary for the progress to be set to 100%, this is done for you.
void init()
Draw the initial progress bar.
void setLength(unsigned int l)
Set the number of markers in the progress bar.
void reset()
reset the progress bar internals, in case we want to re-use it
void update(unsigned int newProgress)
Draw the progress bar as needed, using the given progress value [0,100].