官术网_书友最值得收藏!

Drawing with an uncleared background

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:

  • In Mac OS X, the screen can jitter.
  • In Windows, screen grabbing does not work (more details on screen grabbing can be seen in the Screen grabbing section later in this chapter)
Tip

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.

主站蜘蛛池模板: 陆丰市| 河间市| 林州市| 绥滨县| 江油市| 灵寿县| 卢湾区| 兖州市| 改则县| 湟源县| 阿克| 会宁县| 大荔县| 福海县| 黑龙江省| 鄂托克旗| 韶山市| 迁安市| 富宁县| 靖州| 分宜县| 四会市| 永嘉县| 玉屏| 凤台县| 盐山县| 麻城市| 泸州市| 嘉鱼县| 临西县| 洛扎县| 庆安县| 乌海市| 安远县| 诸暨市| 鹿邑县| 盐山县| 苍南县| 宁波市| 江安县| 伊吾县|