ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/devmain.c
(Generate patch)

Comparing ray/src/rt/devmain.c (file contents):
Revision 1.7 by greg, Tue Jan 30 11:37:52 1990 UTC vs.
Revision 1.9 by greg, Thu Feb 22 12:45:25 1990 UTC

# Line 14 | Line 14 | static char SCCSid[] = "$SunId$ LBL";
14  
15   #include <stdio.h>
16  
17 #include <signal.h>
18
17   #include "color.h"
18  
19   #include "driver.h"
20  
21   int     (*wrnvec)(), (*errvec)(), (*cmdvec)();  /* error vectors, unused */
22  
25 long    nrays = 0;                              /* fake it */
26
23   struct driver   *dev = NULL;                    /* output device */
24  
25   FILE    *devin, *devout;                        /* communications channels */
26  
31 int     notified = 0;                           /* notified parent of input? */
32
27   char    *progname;                              /* driver name */
28  
29 < int     r_clear(), r_paintr(), r_getcur(), r_comout(), r_comin();
29 > int     r_clear(), r_paintr(), r_getcur(), r_comout(), r_comin(), r_flush();
30  
31   int     (*dev_func[NREQUESTS])() = {            /* request handlers */
32                  r_clear, r_paintr,
33 <                r_getcur, r_comout, r_comin
33 >                r_getcur, r_comout,
34 >                r_comin, r_flush
35          };
36  
37  
# Line 102 | Line 97 | r_paintr()                             /* paint a rectangle */
97          COLOR   col;
98          int     xmin, ymin, xmax, ymax;
99  
105        nrays += 5;                     /* pretend */
100          fread((char *)col, sizeof(COLOR), 1, devin);
101          xmin = getw(devin); ymin = getw(devin);
102          xmax = getw(devin); ymax = getw(devin);
103          (*dev->paintr)(col, xmin, ymin, xmax, ymax);
110                                        /* check for input */
111        if (!notified && dev->inpready > 0) {
112                notified = 1;
113                kill(getppid(), SIGIO);
114        }
104   }
105  
106  
107 + r_flush()                               /* flush output */
108 + {
109 +        if (dev->flush != NULL)
110 +                (*dev->flush)();
111 +        putc(COM_FLUSH, devout);
112 +        putw(dev->inpready, devout);
113 +        fflush(devout);
114 + }
115 +
116 +
117   r_getcur()                              /* get and return cursor position */
118   {
119          int     c;
# Line 157 | Line 156 | r_comin()                              /* read string from command line */
156                                          /* reply */
157          putc(COM_COMIN, devout);
158          myputs(buf, devout);
159 +        putw(dev->inpready, devout);
160          fflush(devout);
161                                        /* reset notify */
162        notified = 0;
161   }
162  
163  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines