is there a way to control the speed at which the screen draws that is not related to the framerate at which a program runs or related to refreshing the screen by resetting the background?
for instance, you have a static framerate of 24, but you want to draw at a slower rate for a specified duration of time.
thanks,
01
you can use the modulo operator with ofGetFrameNum()
void ofApp::draw()
{
/*
1 would draw every frame
2 every other frame
3 every third frame, etc
*/
int speedDivisor = 2;
if(ofGetFrameNum() % speedDivisor != 0))
{
return;
}
//draw code here
}
hi jv,
this is a better implementation than refreshing the background after a specified duration of time. i’ll try it out.
thanks.
01