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

Comparing ray/src/rt/x11.c (file contents):
Revision 1.4 by greg, Thu Feb 22 10:22:01 1990 UTC vs.
Revision 1.5 by greg, Thu Feb 22 11:46:26 1990 UTC

# Line 35 | Line 35 | static char SCCSid[] = "$SunId$ LBL";
35   #define COMCW           8               /* approx. character width (pixels) */
36   #define COMCH           14              /* approx. character height (pixels) */
37  
38 #ifndef WFLUSH
39 #define WFLUSH          30              /* flush after this many rays */
40 #endif
41
38   #define  ourscreen      DefaultScreen(ourdisplay)
39   #define  ourroot        RootWindow(ourdisplay,ourscreen)
40   #define  ourwhite       WhitePixel(ourdisplay,ourscreen)
41   #define  ourblack       BlackPixel(ourdisplay,ourscreen)
42  
47 #define  checkinp()     while (XPending(ourdisplay) > 0) getevent()
48
43   #define  levptr(etype)  ((etype *)&currentevent)
44  
45   static XEvent  currentevent;            /* current event */
# Line 74 | Line 68 | static Colormap ourmap;                        /* our color map */
68   extern char  *malloc();
69  
70   int  x11_close(), x11_clear(), x11_paintr(), x11_errout(),
71 <                x11_getcur(), x11_comout(), x11_comin();
71 >                x11_getcur(), x11_comout(), x11_comin(), x11_flush();
72  
73   static struct driver  x11_driver = {
74          x11_close, x11_clear, x11_paintr, x11_getcur,
75 <        x11_comout, x11_comin, 1.0
75 >        x11_comout, x11_comin, x11_flush, 1.0
76   };
77  
78  
# Line 195 | Line 189 | x11_paintr(col, xmin, ymin, xmax, ymax)                /* fill a rec
189   COLOR  col;
190   int  xmin, ymin, xmax, ymax;
191   {
198        extern long  nrays;             /* global ray count */
192          extern int  xnewcolr();         /* pixel assignment routine */
200        static long  lastflush = 0;     /* ray count at last flush */
193  
194          if (ncolors > 0) {
195                  XSetForeground(ourdisplay, ourgc,
# Line 205 | Line 197 | int  xmin, ymin, xmax, ymax;
197                  XFillRectangle(ourdisplay, gwind,
198                          ourgc, xmin, gheight-ymax, xmax-xmin, ymax-ymin);
199          }
200 <        if (nrays - lastflush >= WFLUSH) {
201 <                if (ncolors <= 0)       /* output necessary for death */
202 <                        XFillRectangle(ourdisplay, gwind,
203 <                                        ourgc, 0, 0, 1 ,1);
204 <                checkinp();
205 <                lastflush = nrays;
206 <        }
200 > }
201 >
202 >
203 > static
204 > x11_flush()                     /* flush output */
205 > {
206 >        if (ncolors <= 0)       /* output necessary for death */
207 >                XFillRectangle(ourdisplay, gwind, ourgc, 0, 0, 1 ,1);
208 >        while (XPending(ourdisplay) > 0)
209 >                getevent();
210   }
211  
212  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines