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

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.

主站蜘蛛池模板: 合作市| 瑞金市| 金乡县| 丹江口市| 澳门| 连城县| 泾川县| 盐亭县| 安岳县| 仙游县| 鸡西市| 西城区| 沙湾县| 海南省| 长泰县| 灵台县| 柳河县| 平安县| 钟祥市| 依安县| 三台县| 法库县| 平顶山市| 凌源市| 贺州市| 手机| 翁源县| 化德县| 眉山市| 阳城县| 呼伦贝尔市| 斗六市| 海宁市| 兴国县| 修武县| 樟树市| 凭祥市| 上高县| 灌南县| 白城市| 永靖县|