A significant improvement in speed
Listing 3 also calls the putpixel function inside the inner loop.
In this case, the pointer named buffer is passed as the first parameter in place of the pointer named screen.
This causes the new pixel color values to be written: