window struct now contains the redrawing function.