- Hands-On Game Development with WebAssembly
- Rick Battagline
- 179字
- 2021-06-24 13:41:06
Clearing the SDL renderer
After the initialization is complete, we will need to clear out the renderer. We can clear our renderer with any color we choose. To do this, we will make a call to the SDL_RenderDrawColor function:
SDL_SetRenderDrawColor( renderer, 0, 0, 0, 255 );
SDL_RenderClear( renderer );
That sets the drawing color for the renderer to black with full opacity. 0, 0, 0 are the RGB color values, and 255 is the alpha opacity. These numbers all range from 0 to 255, where 255 is the full color on the color spectrum. We set this up so that when we call the SDL_RenderClear function in the next line, it will clear the renderer with the color black. If we wanted the color to clear red instead of black, we would have to modify the call in the following way:
SDL_SetRenderDrawColor( renderer, 255, 0, 0, 255 );
That is not what we want, so we will not make that change. I just wanted to point out that we could clear the renderer with any color we like.
- Aftershot Pro:Non-destructive photo editing and management
- 深入理解Spring Cloud與實戰
- Raspberry Pi 3 Cookbook for Python Programmers
- 現代辦公設備使用與維護
- 3ds Max Speed Modeling for 3D Artists
- Unity 5.x Game Development Blueprints
- Apple Motion 5 Cookbook
- VCD、DVD原理與維修
- 面向對象分析與設計(第3版)(修訂版)
- 龍芯自主可信計算及應用
- 筆記本電腦維修實踐教程
- 單片機技術及應用
- 基于S5PV210處理器的嵌入式開發完全攻略
- MicroPython Cookbook
- 3D打印:Geomagic Design X5.1 逆向建模設計實用教程