Infinitely looping animations...

Marko van Eekelen marko@cs.kun.nl
Thu, 26 Jun 1997 14:52:00 +0200


>Hi..
>
>I've written a program that I want to animate infinitely. The only way I
>can concieve of doing this is an infinite recursion. Obviously, this is not
>a good thing, as requiring the user to kill the app using <ctrl><alt><del>
>(in win95 atleast) is not cool.
> Any suggestions?
>
>-Nick

Dear Nick,

Infinite recursion can be used e.g. when you  write a function doping console-like input/output (using stdio from the IO/library). As Pieter Koopman state this will indeed NOT cause stacks or heaps to overflow.

For your problem soemthing similer to the Life demo example which is included in the distribution seems to be appropriate.

As in the life example you define a menu system that contains a quit function to stop your program. 
Than you can stop your program in a nice way. 

And you use a timer to repeatedly draw the next part of your animation.

Marko van Eekelen.
Nijmegen University.