Double buffering

This is an example, how to do and use double buffering (offscreen window) to create smooth animations