www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/23/12:20:47

From: Ian D Romanick <idr AT cs DOT pdx DOT edu>
Message-Id: <199704231559.IAA24835@xavier.cs.pdx.edu>
Subject: Re: Measuring frame rate more often
To: tgrand AT canvaslink DOT com
Date: Wed, 23 Apr 1997 08:59:24 -0700 (PDT)
Cc: djgpp AT delorie DOT com
In-Reply-To: <335E030E.B42@canvaslink.com> from "Tom Grandgent" at Apr 23, 97 08:39:42 am
MIME-Version: 1.0

> > You could attempt this by using some form of external counter that
> > you can refer to each time you flip pages.
> 
> Yes, I sort of tried this last night- I tried to measure the number
> of milliseconds that it took to draw one frame.

This is *NOT* the right way to do this.  The right way uses a single
timer interrupt going at whatever your target rate is.  Just update your
position values during the interrupt.  You will need to be careful to
make sure that the position values don't get modified while you're using
them.  Use some type of double buffering...I leave this as an exercise
for the reader.  If your interrupt rate is high enough (perhaps 2x the
refresh rate of the display mode), this should look OK.

-- 
He asks a girl if they can both sit in a chair,
but he doesn't get nervous: she's not really there!

http://www.cs.pdx.edu/~idr is the home of the Dancing Fool

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019