ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rhdriver.h
Revision: 3.12
Committed: Tue Jan 6 05:26:20 1998 UTC (26 years, 2 months ago) by gregl
Content type: text/plain
Branch: MAIN
Changes since 3.11: +7 -0 lines
Log Message:
created dev_clear() routine to clear device ray cache

File Contents

# Content
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 extern int imm_mode; /* bundles are being delivered immediately */
19
20 /* user commands */
21 #define DC_SETVIEW 0 /* set the view */
22 #define DC_GETVIEW 1 /* print the current view */
23 #define DC_LASTVIEW 2 /* restore previous view */
24 #define DC_PAUSE 3 /* pause the current calculation */
25 #define DC_RESUME 4 /* resume the calculation */
26 #define DC_REDRAW 5 /* redraw from server */
27 #define DC_KILL 6 /* kill rtrace process(es) */
28 #define DC_RESTART 7 /* restart rtrace process(es) */
29 #define DC_CLOBBER 8 /* clobber holodeck file */
30 #define DC_QUIT 9 /* quit the program */
31
32 #define DC_NCMDS 10 /* number of commands */
33
34 /* dev_input() returns flags from above */
35 #define DFL(dc) (1<<(dc))
36
37 #define CTRL(c) ((c)-'@')
38 /* commands entered in display window */
39 #define DV_INIT {'\0','v','l','p','\r',CTRL('L'),'K','R','C','q'}
40 /* commands entered on stdin */
41 #define DC_INIT {"VIEW=","where","last","pause","resume","redraw",\
42 "kill","restart","clobber","quit"}
43
44
45 /************************************************************************
46 * Driver routines (all are required):
47
48
49 void
50 dev_open(nm) : prepare the device
51 char *nm; : appropriate title bar annotation
52
53 Sets fields of odev structure and prepares the display for i/o.
54 The view type, horizontal and vertical view angles and other default
55 parameters in odev.v should also be assigned.
56
57
58 int
59 dev_view(nv) : set display view parameters
60 VIEW *nv; : the new view
61
62 Updates the display for the given view change.
63 Look for nv==&odev.v when making view current after dev_input()
64 returns DEV_NEWVIEW flag. Return 1 on success, or 0 if the
65 new view would conflict with device requirements. In the latter
66 case, reset parameters in nv to make it more agreeable, calling
67 error(COMMAND, "appropriate user warning").
68
69
70 void
71 dev_clear() : clear device memory
72
73 Clear the device memory in preparation for fresh data. Clearing
74 the screen is optional.
75
76
77 void
78 dev_value(c, p, v) : register new point of light
79 COLR c; : pixel color (RGBE)
80 FVECT p; : world intersection point
81 FVECT v; : ray direction vector
82
83 Add the given color point to the display output queue. If imm_mode is
84 non-zero, then values are being sent in rapid succession.
85
86
87 int
88 dev_flush() : flush the output and prepare for select call
89
90 Updates display, taking any pending action required before select(2) call.
91 Returns non-zero if there is device input available.
92
93
94 int
95 dev_input() : process pending display input
96
97 Called when odev struct file descriptor shows input is ready.
98 Returns flags indicating actions to take in the control process.
99 If the DC_VIEW or DC_RESIZE flag is returned, the odev
100 structure must be updated beforehand.
101
102
103 void
104 dev_close() : close the display
105
106 Close the display device and free up resources in preparation for exit.
107 Set odev.v.type=0 and odev.hres=odev.vres=0 when done.
108
109
110 ************************************************************************/