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

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.

主站蜘蛛池模板: 广宁县| 永顺县| 通化市| 龙海市| 车险| 敖汉旗| 资溪县| 湖口县| 桂林市| 元江| 建始县| 定西市| 关岭| 阜平县| 常熟市| 景德镇市| 罗平县| 通州区| 读书| 曲周县| 镇雄县| 金阳县| 南溪县| 泾川县| 当雄县| 虞城县| 嘉兴市| 辽阳市| 个旧市| 竹山县| 河南省| 铁岭市| 武定县| 大余县| 巩留县| 通许县| 榆中县| 万载县| 滁州市| 古浪县| 台州市|