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

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.

主站蜘蛛池模板: 沁源县| 保定市| 林芝县| 扎囊县| 金堂县| 大洼县| 建平县| 余姚市| 当阳市| 沁水县| 盐津县| 广宁县| 大厂| 奉节县| 汝州市| 淮安市| 庆云县| 德清县| 惠水县| 徐水县| 金山区| 灵璧县| 沧源| 梨树县| 民县| 依安县| 宿迁市| 内乡县| 阿克陶县| 乐平市| 六枝特区| 资中县| 卢湾区| 延长县| 天全县| 鸡东县| 邵东县| 普宁市| 田林县| 崇州市| 嘉鱼县|