Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

Resetting ofGetElapsedTimeMilles

$
0
0

@cyrstem wrote:

hi i been trying to make an FBO to fade away in a short amount of time
but i like it to happen continuously thats why im trying to use ofGetElapsedTimeMilles so when it get to a second or more the fbo clears but i like it to happen all the time so is there a way to reset the ofGetElapsedTimeMilles value back to 0 and to started again so it happens continuously to the fbo can someone give a clue how to ?
on the ofApp.h
/////////////////////////////
float startTime;
float endTime;
bool bTimerReached;
/////////////////////////////
ofApp.cpp
setup()
startTime =ofGetElapsedTimeMillis();
endTime =1000;
bTimerReached =false;
update()
float timer = ofGetElapsedTimeMillis() - startTime;
if(timer >= endTime && !bTimerReached) {
bTimerReached = true;
dotFbo.begin();
ofClear(255,255,255);
dotFbo.end();

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles