The clear_to_color function

The clear_to_color function  (Listing 2) is straightforward.

The first parameter is a pointer to the bitmap for which the color of all the pixels is to be set.

In this case, that pointer is contained in a global variable named screen in the header file that is included in Listing 1.