1 |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
2 |
|
3 |
/* SCCSid "$SunId$ SGI" */ |
4 |
|
5 |
/* |
6 |
* Header file for holodeck device driver routines. |
7 |
*/ |
8 |
|
9 |
#include "view.h" |
10 |
|
11 |
extern struct driver { |
12 |
char *name; /* holodeck name or title */ |
13 |
VIEW v; /* preferred view parameters */ |
14 |
int hres, vres; /* device resolution */ |
15 |
int ifd; /* input file descriptor (for select) */ |
16 |
} odev; /* our open device */ |
17 |
|
18 |
/* dev_input() return flags */ |
19 |
#define DEV_SHUTDOWN 01 /* user shutdown request */ |
20 |
#define DEV_NEWVIEW 02 /* view change (new view in odev.v) */ |
21 |
#define DEV_NEWSIZE 04 /* device resolution change */ |
22 |
|
23 |
|
24 |
/************************************************************************ |
25 |
* Driver routines (all are required): |
26 |
|
27 |
|
28 |
void |
29 |
dev_open(nm) : prepare the device |
30 |
char *nm; : appropriate title bar annotation |
31 |
|
32 |
Sets fields of odev structure and prepares the display for i/o. |
33 |
The view type, horizontal and vertical view angles and other default |
34 |
parameters in odev.v should also be assigned. |
35 |
|
36 |
|
37 |
void |
38 |
dev_view(nv) : set display view parameters |
39 |
VIEW *nv; : the new view |
40 |
|
41 |
Updates the display for the given view change. |
42 |
Look for nv==&odev.v when making view current after dev_input() |
43 |
returns DEV_NEWVIEW flag. |
44 |
|
45 |
|
46 |
void |
47 |
dev_value(c, p) : register new point of light |
48 |
COLR c; : pixel color (RGBE) |
49 |
FVECT p; : world intersection point |
50 |
|
51 |
Add the given color point to the display output queue. |
52 |
|
53 |
|
54 |
int |
55 |
dev_flush() : flush the output and prepare for select call |
56 |
|
57 |
Updates display, taking any pending action required before select(2) call. |
58 |
Returns non-zero if there is device input available. |
59 |
|
60 |
|
61 |
int |
62 |
dev_input() : process pending display input |
63 |
|
64 |
Called when odev struct file descriptor shows input is ready. |
65 |
Returns flags indicating actions to take in the control process. |
66 |
If the DEV_NEWVIEW or DEV_NEWSIZE flag is returned, the odev |
67 |
structure must be updated beforehand. |
68 |
|
69 |
|
70 |
void |
71 |
dev_close() : close the display |
72 |
|
73 |
Close the display device and free up resources in preparation for exit. |
74 |
Set odev.v.type=0 and odev.hres=odev.vres=0 when done. |
75 |
|
76 |
|
77 |
************************************************************************/ |