TIMERn devices - what are they?
stephen Samuel
steve at obed.uucp
Mon Aug 14 01:54:25 AEST 1989
>From article <10976 at watcgl.waterloo.edu>, by fjhenigman at watcgl.waterloo.edu (Frank J. Henigman):
> Can anyone explain what the devices TIMERn (where n = 0, 1, 2, 3) are
> in the device.h file? Can they be used for anything? Thanks.
The timer devices generate one event every 1/60 sec. More specificly,
they seem to generate one per vertical sync. They can be used for various
things.
We, for example, have a Tektronix stereo LCD shutter. To use it, we start up
a timer, and for each timer event, we do a swapbuffers (first, of course,
we have to draw the two stereo pictures...).
roughly (from memory):
In this case, we need one event per 1/60 sec, so I use `noise(1)`. If you
needed only needed 5 events per second then you could use `noise(12)`.
------------------------ Cut here and add water -------------------------
#include "everything.necessary"
draw(leftimage);
swapbuffer();
draw(rightimage);
swapbuffer();
qdevice(TIMER0);
noise(TIMER0,1); /* **** VERY IMPORTANT -- you need to do this before
* you get timer events --- THIS IS UNDOCUMENTED (grr!) */
/* the following will wait for an odd-numbered timer event... This is
*an attempt to make sync left and right sides with what the shutter
*thinks are the appropriate side.
*/
while(qread(&val)!= TIMER0 || (val&1)!= 1 );
while( happy){
device=qread(&val);
switch(device){
case TIMER0:
swapbuffer();
break;
. . . .
case blegh:
happy=0;
break;
};
/* EOF */
--
Stephen samuel !alberta!{obed,edm}!steve
"Look on the bright side... It might have worked!"
More information about the Comp.sys.sgi
mailing list