ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rhdriver.h
Revision: 3.2
Committed: Thu Nov 20 18:06:16 1997 UTC (26 years, 5 months ago) by gregl
Content type: text/plain
Branch: MAIN
Changes since 3.1: +1 -0 lines
Log Message:
added pause function

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