- 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.
- Cortex-M3 + μC/OS-II嵌入式系統開發入門與應用
- 數字道路技術架構與建設指南
- INSTANT Wijmo Widgets How-to
- The Applied AI and Natural Language Processing Workshop
- Learning Stencyl 3.x Game Development Beginner's Guide
- VCD、DVD原理與維修
- 嵌入式系統中的模擬電路設計
- Visual Media Processing Using Matlab Beginner's Guide
- Arduino BLINK Blueprints
- 基于Proteus仿真的51單片機應用
- Intel Edison智能硬件開發指南:基于Yocto Project
- RISC-V處理器與片上系統設計:基于FPGA與云平臺的實驗教程
- Intel FPGA權威設計指南:基于Quartus Prime Pro 19集成開發環境
- The Artificial Intelligence Infrastructure Workshop
- Spring Security 3.x Cookbook