Mail Archives: djgpp/1997/04/23/08:53:35
Robert Humphris wrote:
>
> Tom
>
> You could attempt this by using some form of external counter that
> you can refer to each time you flip pages. How you do this I don't
> know as I work in embedded systems that have all manner of clocks
> for just this sort of thing. Does the PC have a microsecond clock?
> if so just refer to it and compare previous times. if there is no
> clock, and you think that the overheads will not be too great, set
> an interrupt to occur every so often ( mS ) and count the number of
> times that it has occurred between page flips. To overcome the
> overhead of the interrupts you might want to create a look up table
> of logical speeds ranging from the fastest frame rate to that of the
> slowest, therefore you will not incur the time penalty of performing
> the recalculation each time.
>
> Rob Humphris
Yes, I sort of tried this last night- I tried to measure the number
of milliseconds that it took to draw one frame. Unfortunately the
results varyed widely- for example, they could go 55ms, 45ms, 75ms..
Always in multiples of 5. Of course, this -was- under Win95.. :)
So the jumpiness is still in the game... Maybe my formula change
was incorrect, but I don't think the millisecond measurements from
my interrupt being called every millisecond are accurate. Anyway:
Old (for frames per second):
effective_speed = logical_speed * (1 / fps / TARGET_FPS);
New (for milliseconds per frame):
effective_speed = logical_speed * (1 / ms / TARGET_MS);
Thanks for your help,
Tom Grandgent
tgrand AT canvaslink DOT com
Canvas Link, Inc.
- Raw text -