ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rhdriver.h
(Generate patch)

Comparing ray/src/hd/rhdriver.h (file contents):
Revision 3.6 by gregl, Mon Dec 8 18:51:15 1997 UTC vs.
Revision 3.16 by gwlarson, Wed Aug 19 17:43:08 1998 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1997 Silicon Graphics, Inc. */
1 > /* Copyright (c) 1998 Silicon Graphics, Inc. */
2  
3   /* SCCSid "$SunId$ SGI" */
4  
# Line 10 | Line 10
10  
11   extern struct driver {
12          char    *name;          /* holodeck name or title */
13 <        VIEW    v;              /* preferred view parameters */
14 <        int     hres, vres;     /* device resolution */
13 >        VIEW    v;              /* base view parameters */
14 >        int     hres, vres;     /* base view resolution */
15          int     ifd;            /* input file descriptor (for select) */
16 +        int     inpready;       /* number of unprocessed input events */
17   } odev;                 /* our open device */
18  
19 <                        /* 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 < #define DEV_WAIT        010     /* pause computation and wait for input */
23 < #define DEV_RESUME      020     /* resume after pause */
24 < #define DEV_REDRAW      040     /* redraw from server */
25 < #define DEV_PUTVIEW     0100    /* print out current view */
19 > extern int      imm_mode;       /* bundles are being delivered immediately */
20  
21 + extern double   eyesepdist;     /* world eye separation distance */
22  
23 +                                /* user commands */
24 + #define DC_SETVIEW      0               /* set the base view */
25 + #define DC_GETVIEW      1               /* print the current base view */
26 + #define DC_LASTVIEW     2               /* restore previous view */
27 + #define DC_PAUSE        3               /* pause the current calculation */
28 + #define DC_RESUME       4               /* resume the calculation */
29 + #define DC_REDRAW       5               /* redraw from server */
30 + #define DC_KILL         6               /* kill rtrace process(es) */
31 + #define DC_RESTART      7               /* restart rtrace process(es) */
32 + #define DC_CLOBBER      8               /* clobber holodeck file */
33 + #define DC_QUIT         9               /* quit the program */
34 +
35 + #define DC_NCMDS        10              /* number of commands */
36 +
37 +                                /* dev_input() returns flags from above */
38 + #define DFL(dc)         (1<<(dc))
39 +
40 + #define CTRL(c)         ((c)-'@')
41 +                                /* commands entered in display window */
42 + #define DV_INIT         {'\0','v','l','p','\r',CTRL('L'),'K','R','C','q'}
43 +                                /* commands entered on stdin */
44 + #define DC_INIT         {"VIEW=","where","last","pause","resume","redraw",\
45 +                                "kill","restart","clobber","quit"}
46 +
47 +
48   /************************************************************************
49   * Driver routines (all are required):
50  
# Line 34 | Line 54 | dev_open(nm)           : prepare the device
54   char    *nm;            : appropriate title bar annotation
55  
56   Sets fields of odev structure and prepares the display for i/o.
57 < The view type, horizontal and vertical view angles and other default
58 < parameters in odev.v should also be assigned.
57 > The base view type, horizontal and vertical view angles and other
58 > default parameters in odev.v should also be assigned.
59  
60  
61 < void
62 < dev_view(nv)            : set display view parameters
61 > int
62 > dev_view(nv)            : set base view parameters
63   VIEW    *nv;            : the new view
64  
65 < Updates the display for the given view change.
65 > Updates the display for the given base view change.
66   Look for nv==&odev.v when making view current after dev_input()
67 < returns DEV_NEWVIEW flag.
67 > returns DEV_NEWVIEW flag.  Return 1 on success, or 0 if the
68 > new view would conflict with device requirements.  In the latter
69 > case, reset parameters in nv to make it more agreeable, calling
70 > error(COMMAND, "appropriate user warning").
71  
72  
73   void
74 < dev_value(c, p, v)      : register new point of light
74 > dev_clear()             : clear device memory
75 >
76 > Clear the device memory in preparation for fresh data.  Clearing
77 > the screen is optional.
78 >
79 >
80 > void
81 > dev_value(c, d, p)      : register new point of light
82   COLR    c;              : pixel color (RGBE)
83 + FVECT   d;              : ray direction vector
84   FVECT   p;              : world intersection point
54 FVECT   v;              : ray direction vector
85  
86 < Add the given color point to the display output queue.
86 > Add the given color point to the display output queue.  If imm_mode is
87 > non-zero, then values are being sent in rapid succession.  If p is NULL,
88 > then the point is at infinity.
89  
90  
91   int
92   dev_flush()             : flush the output and prepare for select call
93  
94   Updates display, taking any pending action required before select(2) call.
95 < Returns non-zero if there is device input available.
95 > Returns non-zero if there is device input available, setting odev.inpready.
96  
97  
98   int
# Line 68 | Line 100 | dev_input()            : process pending display input
100  
101   Called when odev struct file descriptor shows input is ready.
102   Returns flags indicating actions to take in the control process.
103 < If the DEV_NEWVIEW or DEV_NEWSIZE flag is returned, the odev
104 < structure must be updated beforehand.
103 > If the DC_VIEW or DC_RESIZE flag is returned, the odev
104 > structure must be updated beforehand.  No events will be
105 > ready when this function returns, and odev.inpready will be 0.
106  
107 + void
108 + dev_auxcom(cmd, args)   : process auxiliary command
109 + char    *cmd, *args;    : command name and argument string
110  
111 + Execute an auxiliary command (not one of those listed at the head of
112 + this file).  The cmd argument points to the command name itself, and
113 + the args argument points to a string with the rest of the input line.
114 + If the command isn't known or there ARE no auxiliary commands, print
115 + an appropriate COMMAND error message and return.
116 +
117 +
118 + VIEW *
119 + dev_auxview(n, hv)      : return nth auxiliary view
120 + int     n;              : auxiliary view number
121 + int     hv[2];          : returned horiz. and vert. image resolution
122 +
123 + Return the nth auxiliary view associated with the current base view.
124 + The hv entries are assigned the horizontal and vertical view resolution,
125 + respectively.  Function returns NULL if there are no more auxiliary
126 + views.  The zeroeth auxiliary view is the base view itself.
127 +
128 +
129   void
130   dev_close()             : close the display
131  
# Line 80 | Line 134 | Set odev.v.type=0 and odev.hres=odev.vres=0 when done.
134  
135  
136   ************************************************************************/
137 +
138 +
139 + extern VIEW     *dev_auxview();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines