Changed sdl canvas to use the surplus time of the current frame instead of the previous one when waiting