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.14 by gwlarson, Wed Jun 17 15:44:07 1998 UTC vs.
Revision 3.25 by schorsch, Wed Jun 7 17:52:04 2006 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1998 Silicon Graphics, Inc. */
2 <
3 < /* SCCSid "$SunId$ SGI" */
4 <
1 > /* RCSid: $Id$ */
2   /*
3   * Header file for holodeck device driver routines.
4   */
5 + #ifndef _RAD_RHDRIVER_H_
6 + #define _RAD_RHDRIVER_H_
7  
8   #include "view.h"
9  
10 + #ifdef __cplusplus
11 + extern "C" {
12 + #endif
13 +
14   extern struct driver {
15          char    *name;          /* holodeck name or title */
16          VIEW    v;              /* base view parameters */
17          int     hres, vres;     /* base view resolution */
18          int     ifd;            /* input file descriptor (for select) */
19 +        int     firstuse;       /* non-zero if driver can't recycle samples */
20 +        int     inpready;       /* number of unprocessed input events */
21   } odev;                 /* our open device */
22  
23 + extern char     odev_args[];    /* command arguments, if any */
24 +
25   extern int      imm_mode;       /* bundles are being delivered immediately */
26  
27   extern double   eyesepdist;     /* world eye separation distance */
# Line 23 | Line 30 | extern double  eyesepdist;     /* world eye separation dist
30   #define DC_SETVIEW      0               /* set the base view */
31   #define DC_GETVIEW      1               /* print the current base view */
32   #define DC_LASTVIEW     2               /* restore previous view */
33 < #define DC_PAUSE        3               /* pause the current calculation */
34 < #define DC_RESUME       4               /* resume the calculation */
35 < #define DC_REDRAW       5               /* redraw from server */
36 < #define DC_KILL         6               /* kill rtrace process(es) */
37 < #define DC_RESTART      7               /* restart rtrace process(es) */
38 < #define DC_CLOBBER      8               /* clobber holodeck file */
39 < #define DC_QUIT         9               /* quit the program */
33 > #define DC_FOCUS        3               /* view focus */
34 > #define DC_PAUSE        4               /* pause the current calculation */
35 > #define DC_RESUME       5               /* resume the calculation */
36 > #define DC_REDRAW       6               /* redraw from server */
37 > #define DC_KILL         7               /* kill rtrace process(es) */
38 > #define DC_RESTART      8               /* restart rtrace process(es) */
39 > #define DC_CLOBBER      9               /* clobber holodeck file */
40 > #define DC_QUIT         10              /* quit the program */
41  
42 < #define DC_NCMDS        10              /* number of commands */
42 > #define DC_NCMDS        11              /* number of commands */
43  
44                                  /* dev_input() returns flags from above */
45   #define DFL(dc)         (1<<(dc))
46  
47   #define CTRL(c)         ((c)-'@')
48                                  /* commands entered in display window */
49 < #define DV_INIT         {'\0','v','l','p','\r',CTRL('L'),'K','R','C','q'}
49 > #define DV_INIT         {'\0','v','l','f','p','\r',CTRL('L'),'K','R','C','q'}
50                                  /* commands entered on stdin */
51 < #define DC_INIT         {"VIEW=","where","last","pause","resume","redraw",\
52 <                                "kill","restart","clobber","quit"}
51 > #define DC_INIT         {"VIEW=","where","last","frame","pause","resume",\
52 >                                "redraw","kill","restart","clobber","quit"}
53  
54  
55   /************************************************************************
# Line 77 | Line 85 | the screen is optional.
85  
86  
87   void
88 < dev_value(c, p, v)      : register new point of light
88 > dev_value(c, d, p)      : register new point of light
89   COLR    c;              : pixel color (RGBE)
90 + FVECT   d;              : ray direction vector
91   FVECT   p;              : world intersection point
83 FVECT   v;              : ray direction vector
92  
93   Add the given color point to the display output queue.  If imm_mode is
94 < non-zero, then values are being sent in rapid succession.
94 > non-zero, then values are being sent in rapid succession.  If p is NULL,
95 > then the point is at infinity.
96  
97  
98   int
99   dev_flush()             : flush the output and prepare for select call
100  
101   Updates display, taking any pending action required before select(2) call.
102 < Returns non-zero if there is device input available.
102 > Returns non-zero if there is device input available, setting odev.inpready.
103  
104  
105   int
# Line 99 | Line 108 | dev_input()            : process pending display input
108   Called when odev struct file descriptor shows input is ready.
109   Returns flags indicating actions to take in the control process.
110   If the DC_VIEW or DC_RESIZE flag is returned, the odev
111 < structure must be updated beforehand.
111 > structure must be updated beforehand.  If the DC_FOCUS
112 > flag is set, then odev_args contains the frame dimensions.
113 > No events shall remain when this function returns,
114 > and odev.inpready will therefore be 0.
115  
116   void
117   dev_auxcom(cmd, args)   : process auxiliary command
# Line 124 | Line 136 | views.  The zeroeth auxiliary view is the base view it
136  
137  
138   void
139 + dev_section(gf, pf)     : add geometry and ports for rendering
140 + char    *gf;            : geometry file name
141 + char    *pf;            : portal file name(s)
142 +
143 + Add the given geometry file to the list of geometry to render for
144 + intermediate views if direct geometry rendering is available.  The
145 + second argument gives the name(s) of any portal geometry files
146 + associated with this section.  Multiple portal file names are separated
147 + by spaces.  A single octree file will be given for the geometry, ending
148 + in the ".oct" suffix.  Portal files will be given as zero or more
149 + Radiance scene description file names.  If no portals are given for
150 + this section, the string may be NULL.  The character strings are
151 + guaranteed to be static (or permanently allocated) such that they may
152 + be safely stored as a pointer.  The same pointers or file lists may be
153 + (and often are) given repeatedly.  If a given geometry file does not
154 + exist, the call should be silently ignored.  If gf is NULL, then the
155 + last section has been given, and the display can be updated with the
156 + new information.
157 +
158 +
159 + void
160   dev_close()             : close the display
161  
162   Close the display device and free up resources in preparation for exit.
# Line 133 | Line 166 | Set odev.v.type=0 and odev.hres=odev.vres=0 when done.
166   ************************************************************************/
167  
168  
169 + /*
170   extern VIEW     *dev_auxview();
171 + */
172 + extern int16    *beam_view(VIEW *vn, int hr, int vr);
173 +
174 +
175 + extern void dev_open(char  *id);
176 + extern void dev_close(void);
177 + extern void dev_clear(void);
178 + extern int dev_view(register VIEW *nv);
179 + extern void dev_section(char *gfn, char *pfn);
180 + extern void dev_auxcom(char *cmd, char *args);
181 + extern VIEW *dev_auxview(int n, int hvres[2]);
182 + extern int dev_input(void);
183 + extern void dev_value(COLR c, FVECT d, FVECT p);
184 + extern int dev_flush(void);
185 + extern void dev_paintr(BYTE rgb[3], int xmin, int ymin, int xmax, int ymax);
186 + extern void dev_cone(BYTE rgb[3], FVECT ip, double rad);
187 +
188 + #ifdef __cplusplus
189 + }
190 + #endif
191 + #endif /* _RAD_RHDRIVER_H_ */
192 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines