- 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.
- TensorFlow Lite移動端深度學習
- LabVIEW程序設計基礎與應用
- OpenShift開發指南(原書第2版)
- Cocos2d-x游戲開發:手把手教你Lua語言的編程方法
- Python深度學習
- Oracle數據庫從入門到運維實戰
- 大模型RAG實戰:RAG原理、應用與系統構建
- Elasticsearch Server(Third Edition)
- Raspberry Pi Home Automation with Arduino(Second Edition)
- Python算法詳解
- 好好學Java:從零基礎到項目實戰
- Java圖像處理:基于OpenCV與JVM
- Natural Language Processing with Python Quick Start Guide
- Python Linux系統管理與自動化運維
- Manage Your SAP Projects with SAP Activate