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.8 by greg, Thu Feb 22 11:46:24 1990 UTC vs.
Revision 1.10 by greg, Tue Mar 6 17:44:44 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"
# Line 26 | Line 24 | struct driver  *dev = NULL;                    /* output device */
24  
25   FILE    *devin, *devout;                        /* communications channels */
26  
29 int     notified = 0;                           /* notified parent of input? */
30
27   char    *progname;                              /* driver name */
28  
29   int     r_clear(), r_paintr(), r_getcur(), r_comout(), r_comin(), r_flush();
# Line 61 | Line 57 | char   *argv[];
57          if ((dev = dinit(argv[0], argv[3])) == NULL)
58                  quit(1);
59          putw(COM_RECVM, devout);                /* verify initialization */
64        fwrite((char *)&dev->pixaspect, sizeof(dev->pixaspect), 1, devout);
65        putw(dev->xsiz, devout);
66        putw(dev->ysiz, devout);
60          fflush(devout);
61                                                  /* loop on requests */
62          while ((com = getc(devin)) != EOF) {
# Line 105 | Line 98 | r_paintr()                             /* paint a rectangle */
98          xmin = getw(devin); ymin = getw(devin);
99          xmax = getw(devin); ymax = getw(devin);
100          (*dev->paintr)(col, xmin, ymin, xmax, ymax);
108                                        /* check for input */
109        if (!notified && dev->inpready > 0) {
110                notified = 1;
111                kill(getppid(), SIGIO);
112        }
101   }
102  
103  
# Line 117 | Line 105 | r_flush()                              /* flush output */
105   {
106          if (dev->flush != NULL)
107                  (*dev->flush)();
108 +        putc(COM_FLUSH, devout);
109 +        fwrite((char *)&dev->pixaspect, sizeof(dev->pixaspect), 1, devout);
110 +        putw(dev->xsiz, devout);
111 +        putw(dev->ysiz, devout);
112 +        putw(dev->inpready, devout);
113 +        fflush(devout);
114   }
115  
116  
# Line 162 | 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);
166                                        /* reset notify */
167        notified = 0;
161   }
162  
163  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines