The function save_painting uses the width and height variables of the Painter class.
Swap buffers outside of the draw function.
A screen shot is taken when the data to be drawn is updated.
One function for updating what is drawn.
Changed the window size.