Added OnPaint into gameloop