- Mastering openFrameworks:Creative Coding Demystified
- Denis Perevalov
- 181字
- 2021-08-06 16:54:17
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.
- Python快樂編程:人工智能深度學習基礎
- Mastering Python Scripting for System Administrators
- Wireshark Network Security
- Learn Programming in Python with Cody Jackson
- C++程序設計基礎教程
- Mastering Rust
- C語言程序設計
- 計算機應用基礎(第二版)
- PostgreSQL Developer's Guide
- Python Social Media Analytics
- Flink核心技術:源碼剖析與特性開發(fā)
- C++服務器開發(fā)精髓
- 趣學數(shù)據(jù)結構
- HTML5 and CSS3:Building Responsive Websites
- 零基礎學Java(升級版)