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

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.

主站蜘蛛池模板: 收藏| 太湖县| 白沙| 西城区| 武汉市| 本溪市| 曲周县| 景泰县| 错那县| 黔江区| 蕲春县| 卢湾区| 鹤庆县| 宣恩县| 双城市| 金溪县| 凤阳县| 竹北市| 新和县| 自治县| 大方县| 应用必备| 天水市| 萨嘎县| 沭阳县| 延津县| 灵璧县| 基隆市| 普格县| 桃园县| 和林格尔县| 宁波市| 景德镇市| 岳池县| 白水县| 甘谷县| 桂东县| 慈利县| 德安县| 合肥市| 同德县|