I make a short 2D graphical application that is redrawn every 50 milliseconds. I use glut so i connected my redraw function to the glut timer using glutTimerFunc.
The problem I have is that it burns my CPU! As i make a real-time application which processes input data, my graphic must save the CPU at most.
Here is the code I connect to the glut timer :
void timerFunction(int arg)
rectangle.redraw(); //just calls a display list
glutTimerFunc(50, timerFunction, 0);
So I would like that my graphic consumes CPU only when it is time to refresh.
Thanks in advance.