By default, the screen is cleared each time before testApp:draw()
is called, so you need to draw all the contents of the screen inside testApp::draw()
again and again. It is appropriate in most cases, but sometimes we want the screen to accumulate our drawings. In openFrameworks, you can do this by disabling screen clearing using the ofSetBackgroundAuto( false )
function. All successive drawings will accumulate on the screen. (In this case you should call ofBackground()
rarely, only for clearing the current screen).
This method is very simple to use, but is not flexible enough for serious projects. Also, currently it has some issues:
See an example of using this method in the The bouncing ball example section in Chapter 6, Working with Sounds.
So, when you need to accumulate drawings, we recommend you to use the FBO buffer, which we will explain now.