ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rhdriver.h
Revision: 3.5
Committed: Thu Dec 4 10:54:23 1997 UTC (26 years, 4 months ago) by gregl
Content type: text/plain
Branch: MAIN
Changes since 3.4: +2 -1 lines
Log Message:
added direction vector to dev_value() call

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