Avoiding uneeded redraws...

I’ve been working with Allegro 4 for a while and I’m trying to follow the same principles I use, in openFrameworks. In Allegro, when I want an object to redraw itself I do the following:

  
  
if(someObject->needsRedraw())  
{  
    someObject->draw();  
    // Wait for the next redraw signaling from somewhere...  
    someObject->redraw(false);  
}  
  

…the screen keeps ‘dirty’ and I have full control of the background and where and when something has to be blitted on screen.

Now, I can’t get the same result in OF because the background gets cleared automatically on every frame and after the first blit the screen goes gray again. I tried ofSetBackgroundAuto(false) at the application setup() but if I add that, the object doesn’t draw at all.

Is there a way to acheive what I’m trying to do? Do I have to manipulate some clip area per object draw?

Can anybody give me a hint on this? Thank you.

What kind of objects are you drawing? Images (i.e. textures) behave differently than graphics (i.e. opengl geometry) when you’re trying to only update them every so often, and there’s different approaches. If you’re just doing graphics using either ofRect, ofLine, etc, GL calls, then setting ofSetBackgroundAuto(false); in the setup() works fine for me, so maybe you could post some code if that all you’re doing.