Received: from sunee.waterloo.edu by karazm.math.UH.EDU with SMTP id AA01420 (5.65c/IDA-1.4.4 for ); Thu, 24 Oct 1991 07:42:01 -0500 Received: by sunee.waterloo.edu id ; Thu, 24 Oct 91 08:37:49 -0400 From: Bernie Roehl Message-Id: <9110241237.AA25908@sunee.waterloo.edu> Subject: Some thoughts on shutter-glasses To: glove-list@karazm.math.uh.edu Date: Thu, 24 Oct 91 8:37:46 EDT X-Mailer: ELM [version 2.3 PL11] When interfacing to shutter-glasses, we ideally want to be able to switch eyes every 1/60th of a second. That means we want to do it on every vertical retrace; it would be really nice if the VGA card were to generate an interrupt on vertical retrace, but it doesn't. That leaves only two approaches: - polling - using the timer interrupt The problem with polling is that you have to pepper your high-level code with calls to a routine that checks for vertical retrace and switches the screens and the LCD glasses. That's not too bad, though, since the routine is very simple and very fast. If you miss one swap, it's not the end of the world. The interrupt approach is good, but assumes that you can program the timer to run at *exactly* the framing rate; even a small inaccuracy will cause you to "drift" and miss the retrace. Alternatively, you could reprogram the timer on each vertical retrace, and thereby eliminate the inaccuracy. Bear in mind that if you're supporting both the glasses and the glove, you now have a few things to do on timer interrupts; this may be the way to go, but requires some more thought. (At least, *I* require some more thought). (A first pass:) The glove gets polled every 4 ms, the display gets swapped every 16 ms; so... timer interrupt routine runs every 4 ms, and does the following: - increment a counter - if the counter reaches 4: - wait for a vertical retrace - reprogram the timer - swap the display - zero the counter - in any case, do the glove stuff Now, waiting for a vertical retrace is a bad idea if we just missed one; we'll miss glove events, for one thing. However, this shouldn't happen after the first time through. Reprogramming the timer may be more serious; will we wind up with major inaccuracies? Will the system time-of-day clock drift? Any feedback would be appreciated... -- Bernie Roehl, University of Waterloo Electrical Engineering Dept Mail: broehl@sunee.waterloo.edu OR broehl@sunee.UWaterloo.ca BangPath: watmath!sunee!broehl Voice: (519) 885-1211 x 2607 [work]