1 |
< |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
1 |
> |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
|
|
3 |
|
/* SCCSid "$SunId$ SGI" */ |
4 |
|
|
13 |
|
VIEW v; /* base view parameters */ |
14 |
|
int hres, vres; /* base view resolution */ |
15 |
|
int ifd; /* input file descriptor (for select) */ |
16 |
+ |
int firstuse; /* non-zero if driver can't recycle samples */ |
17 |
+ |
int inpready; /* number of unprocessed input events */ |
18 |
|
} odev; /* our open device */ |
19 |
|
|
20 |
+ |
extern char odev_args[]; /* command arguments, if any */ |
21 |
+ |
|
22 |
|
extern int imm_mode; /* bundles are being delivered immediately */ |
23 |
|
|
24 |
+ |
extern double eyesepdist; /* world eye separation distance */ |
25 |
+ |
|
26 |
|
/* user commands */ |
27 |
|
#define DC_SETVIEW 0 /* set the base view */ |
28 |
|
#define DC_GETVIEW 1 /* print the current base view */ |
29 |
|
#define DC_LASTVIEW 2 /* restore previous view */ |
30 |
< |
#define DC_PAUSE 3 /* pause the current calculation */ |
31 |
< |
#define DC_RESUME 4 /* resume the calculation */ |
32 |
< |
#define DC_REDRAW 5 /* redraw from server */ |
33 |
< |
#define DC_KILL 6 /* kill rtrace process(es) */ |
34 |
< |
#define DC_RESTART 7 /* restart rtrace process(es) */ |
35 |
< |
#define DC_CLOBBER 8 /* clobber holodeck file */ |
36 |
< |
#define DC_QUIT 9 /* quit the program */ |
30 |
> |
#define DC_FOCUS 3 /* view focus */ |
31 |
> |
#define DC_PAUSE 4 /* pause the current calculation */ |
32 |
> |
#define DC_RESUME 5 /* resume the calculation */ |
33 |
> |
#define DC_REDRAW 6 /* redraw from server */ |
34 |
> |
#define DC_KILL 7 /* kill rtrace process(es) */ |
35 |
> |
#define DC_RESTART 8 /* restart rtrace process(es) */ |
36 |
> |
#define DC_CLOBBER 9 /* clobber holodeck file */ |
37 |
> |
#define DC_QUIT 10 /* quit the program */ |
38 |
|
|
39 |
< |
#define DC_NCMDS 10 /* number of commands */ |
39 |
> |
#define DC_NCMDS 11 /* number of commands */ |
40 |
|
|
41 |
|
/* dev_input() returns flags from above */ |
42 |
|
#define DFL(dc) (1<<(dc)) |
43 |
|
|
44 |
|
#define CTRL(c) ((c)-'@') |
45 |
|
/* commands entered in display window */ |
46 |
< |
#define DV_INIT {'\0','v','l','p','\r',CTRL('L'),'K','R','C','q'} |
46 |
> |
#define DV_INIT {'\0','v','l','f','p','\r',CTRL('L'),'K','R','C','q'} |
47 |
|
/* commands entered on stdin */ |
48 |
< |
#define DC_INIT {"VIEW=","where","last","pause","resume","redraw",\ |
49 |
< |
"kill","restart","clobber","quit"} |
48 |
> |
#define DC_INIT {"VIEW=","where","last","frame","pause","resume",\ |
49 |
> |
"redraw","kill","restart","clobber","quit"} |
50 |
|
|
51 |
|
|
52 |
|
/************************************************************************ |
82 |
|
|
83 |
|
|
84 |
|
void |
85 |
< |
dev_value(c, p, v) : register new point of light |
85 |
> |
dev_value(c, d, p) : register new point of light |
86 |
|
COLR c; : pixel color (RGBE) |
87 |
+ |
FVECT d; : ray direction vector |
88 |
|
FVECT p; : world intersection point |
81 |
– |
FVECT v; : ray direction vector |
89 |
|
|
90 |
|
Add the given color point to the display output queue. If imm_mode is |
91 |
< |
non-zero, then values are being sent in rapid succession. |
91 |
> |
non-zero, then values are being sent in rapid succession. If p is NULL, |
92 |
> |
then the point is at infinity. |
93 |
|
|
94 |
|
|
95 |
|
int |
96 |
|
dev_flush() : flush the output and prepare for select call |
97 |
|
|
98 |
|
Updates display, taking any pending action required before select(2) call. |
99 |
< |
Returns non-zero if there is device input available. |
99 |
> |
Returns non-zero if there is device input available, setting odev.inpready. |
100 |
|
|
101 |
|
|
102 |
|
int |
105 |
|
Called when odev struct file descriptor shows input is ready. |
106 |
|
Returns flags indicating actions to take in the control process. |
107 |
|
If the DC_VIEW or DC_RESIZE flag is returned, the odev |
108 |
< |
structure must be updated beforehand. |
108 |
> |
structure must be updated beforehand. If the DC_FOCUS |
109 |
> |
flag is set, then odev_args contains the frame dimensions. |
110 |
> |
No events shall remain when this function returns, |
111 |
> |
and odev.inpready will therefore be 0. |
112 |
|
|
113 |
+ |
void |
114 |
+ |
dev_auxcom(cmd, args) : process auxiliary command |
115 |
+ |
char *cmd, *args; : command name and argument string |
116 |
|
|
117 |
+ |
Execute an auxiliary command (not one of those listed at the head of |
118 |
+ |
this file). The cmd argument points to the command name itself, and |
119 |
+ |
the args argument points to a string with the rest of the input line. |
120 |
+ |
If the command isn't known or there ARE no auxiliary commands, print |
121 |
+ |
an appropriate COMMAND error message and return. |
122 |
+ |
|
123 |
+ |
|
124 |
|
VIEW * |
125 |
|
dev_auxview(n, hv) : return nth auxiliary view |
126 |
|
int n; : auxiliary view number |
133 |
|
|
134 |
|
|
135 |
|
void |
136 |
+ |
dev_section(otf) : add octree geometry for rendering |
137 |
+ |
char *otf; : octree and portal file names |
138 |
+ |
|
139 |
+ |
Add the given octree file to the list of geometry to be used to render |
140 |
+ |
intermediate views if direct geometry rendering is available. Additional |
141 |
+ |
file names (separated by spaces) are Radiance scene files containing |
142 |
+ |
the geometry for "portals" to separate sections. The given |
143 |
+ |
character string is guaranteed to be static (or permanently allocated) |
144 |
+ |
such that it may be safely stored as a pointer. The same pointer or |
145 |
+ |
file list may be (and often is) given repeatedly. If a given octree |
146 |
+ |
does not exist, the call should be silently ignored. If otn is NULL, |
147 |
+ |
then the last octree has been given, and the display can be updated |
148 |
+ |
with the new information. |
149 |
+ |
|
150 |
+ |
|
151 |
+ |
void |
152 |
|
dev_close() : close the display |
153 |
|
|
154 |
|
Close the display device and free up resources in preparation for exit. |
159 |
|
|
160 |
|
|
161 |
|
extern VIEW *dev_auxview(); |
162 |
+ |
|
163 |
+ |
extern int *beam_view(); |