home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Zone
/
VRZONE.ISO
/
mac
/
PC
/
PCGLOVE
/
GLOVE
/
ROUTINES.DOC
< prev
next >
Wrap
Text File
|
1991-11-07
|
2KB
|
45 lines
glove_init(mode, function)
puts the glove into a given mode; the following are defined so far:
HIRES -- high-resolution
LORES -- low-resolution
IHIRES -- interrupt-driven high-resolution
ILORES -- interrupt-driven low-resolution
Note that the code as supplied always uses high resolution, but
will still accept LORES and ILORES as valid modes; glove_init()
will return the mode *actually* selected (for forwards and
backwards compatability).
The function, if not NULL, is a pointer to a function to be called
from the interrupt handler every time the glove position changes.
glove_quit()
Basically just restores the interrupt vectors that were taken over
by glove_init() if an interrupt mode (IHIRES or ILORES) was used;
must be called before exiting, so glove_init() uses atexit() to
set this.
glove_read(&glov)
Reads the current glove data; this may be called at any time (no
need to poll) if in interrupt mode. Returns non-zero if the data
has changed since the last time you called glove_read().
glove_ready()
Always returns 1 in interrupt modes; otherwise, polls the glove and
returns 1 if it's ready. Not needed in interrupt mode.
glove_delay()
Used only in polled mode, this routine should be called between
calls to glove_ready() to make sure we aren't confusing the glove's
processor by bugging it too often.
The glove data structure (glove_data) now contains an "nmissed" field,
which is the number of samples we've missed between calls to glove_read().
Note that deglitching and dehysterisis are done in the interrupt handler,
so the caller never needs to worry about it.
--
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]