Reading frames from fbo to deque

Hi everyone,

I try to create a slit scan effect, but instead of reading a video file I want to use an fbo. I try to store the frames in a deque, to have access to older frames later. I want to store always 150 frames at a time. The problem is that there is just one frame in the deque. Does somebody know how to store more? There is nothing like “.isFrameNew()” for fbos.

Would be glad about some help.
Best, David

header:

//...
ofFbo fbo1;
void drawfbo1();
deque<ofPixels> frames;
int N;
//...

update:

//...
int N = 150;
fbo1.begin();
    ofClear(255, 255, 255, 0);
    drawfbo1();
fbo1.end();
ofPixels pixels;
fbo1.readToPixels(pixels);
//ofLog(OF_LOG_NOTICE, "pixels " + ofToString(pixels.size()));
frames.push_front(pixels);
//ofLog(OF_LOG_NOTICE, "frames " + ofToString(frames.size()));
if (frames.size() > N){
   frames.pop_back();
}
//...

Hi! This doesn’t solve the problem using deque, but a naive suggestion might be that you declare an array of 150 FBOs in your header file, then in setup you loop through and declare the size of each frame using yourFBO[i].allocate(ofGetWidth(), ofGetHeight()) , then in the update function you access the fbo using ofGetFrameNum()%150.

im not sure what your prior experience is so lmk if you have questions! & sorry if this was insultingly simple!