Mail Archives: djgpp/1998/02/06/16:00:55
Jean-Luc Romano wrote:
> Hi, again.
>
> while (!quitflag) /* event loop */
> {
> /* Event loop stuff */
>
> prepare_buffer();
> regulate();
> blit(buffer, screen, 0, 0, 0, 0, SCREEN_W, SCREEN_H);
> }
>
> And my regulate function is:
>
> void regulate() /* uses the timer to make sure a min amount
> of time is spent each event loop */
> {
> while (timer < 100_milliseconds) /* has .1 secs passed yet? */
> {
> /* Do nothing -- just wait out the timer */
> }
> timer = 0; /* once done waiting, reset the timer */
> }
Hi,
You really should install a timer by hooking interrupt 0. It will be
called 18.2 times/sec. Let your handler set a flag that it's allowed to
draw a new frame...
Reinier
- Raw text -