localized "erase" for backgroundAuto(false) mode


Just wondering if anyone has worked with any animations in ofSetBackgroundAuto(false); mode.

Basically I’m trying to capture the screen behind my element, then use that image to “erase” my element before I draw it again in a new location.

I’m thinking I may be in over my head on this one… unless there is perhaps some way to have backgroundAuto true at one draw level, and false at a different.

… actually that gets me to thinking, maybe i can draw the stuff I want on the backgroundAuto(false) level, make a capture of that, then draw the stuff I want on the backgroundAuto(true) level on top.

I think that method would work, but wonder if anyone has any ideas that might be a better approach?

Edit: did a quick test, and the method I described works pretty nicely… but as I expected, the constant bg capturing/redrawing slows the frame rate quite significantly (from about 420+ down to 65-70).

Maybe there is a better way if I use openGL buffers versus an ofImage?

yup, sounds like you wanna draw to an FBO (drawing to offscreen texture). theres a couple of examples on the forum if you search.

ok… so I did some reading into using FBO’s … seems like it would work perfectly for what I want to do. Only problem is that I can’t find where to get a working version for OF 006. Any ideas where I could download it?

Found it! http://forum.openframeworks.cc/t/fbo-addon-for-0.06/1866/0

Thanks for the help memo! The FBOTexture solves my problem perfectly… and doesn’t destroy my frame rate!