Fix some compiler warnings.
Add a timer for swapping.
Improve performance for background rendering if no image is provided.

Instead of rendering an image, just call fillRect with the background color.