ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rhdriver.h
Revision: 3.6
Committed: Mon Dec 8 18:51:15 1997 UTC (26 years, 3 months ago) by gregl
Content type: text/plain
Branch: MAIN
Changes since 3.5: +1 -0 lines
Log Message:
added command reading from server's stdin

File Contents

# User Rev Content
1 gregl 3.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 gregl 3.4 #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 gregl 3.3 #define DEV_RESUME 020 /* resume after pause */
24 gregl 3.4 #define DEV_REDRAW 040 /* redraw from server */
25 gregl 3.6 #define DEV_PUTVIEW 0100 /* print out current view */
26 gregl 3.1
27    
28     /************************************************************************
29     * Driver routines (all are required):
30    
31    
32     void
33     dev_open(nm) : prepare the device
34     char *nm; : appropriate title bar annotation
35    
36     Sets fields of odev structure and prepares the display for i/o.
37     The view type, horizontal and vertical view angles and other default
38     parameters in odev.v should also be assigned.
39    
40    
41     void
42     dev_view(nv) : set display view parameters
43     VIEW *nv; : the new view
44    
45     Updates the display for the given view change.
46     Look for nv==&odev.v when making view current after dev_input()
47     returns DEV_NEWVIEW flag.
48    
49    
50     void
51 gregl 3.5 dev_value(c, p, v) : register new point of light
52 gregl 3.1 COLR c; : pixel color (RGBE)
53     FVECT p; : world intersection point
54 gregl 3.5 FVECT v; : ray direction vector
55 gregl 3.1
56     Add the given color point to the display output queue.
57    
58    
59     int
60     dev_flush() : flush the output and prepare for select call
61    
62     Updates display, taking any pending action required before select(2) call.
63     Returns non-zero if there is device input available.
64    
65    
66     int
67     dev_input() : process pending display input
68    
69     Called when odev struct file descriptor shows input is ready.
70     Returns flags indicating actions to take in the control process.
71     If the DEV_NEWVIEW or DEV_NEWSIZE flag is returned, the odev
72     structure must be updated beforehand.
73    
74    
75     void
76     dev_close() : close the display
77    
78     Close the display device and free up resources in preparation for exit.
79     Set odev.v.type=0 and odev.hres=odev.vres=0 when done.
80    
81    
82     ************************************************************************/