36 |
|
#define COMCW 8 /* approx. character width (pixels) */ |
37 |
|
#define COMCH 13 /* approx. character height (pixels) */ |
38 |
|
|
39 |
– |
#ifndef WFLUSH |
40 |
– |
#define WFLUSH 30 /* flush after this many rays */ |
41 |
– |
#endif |
42 |
– |
|
43 |
– |
#define checkinp() while (XPending() > 0) getevent() |
44 |
– |
|
39 |
|
#define levptr(etype) ((etype *)&thisevent) |
40 |
|
|
41 |
|
static XEvent thisevent; /* current event */ |
62 |
|
extern char *progname; |
63 |
|
|
64 |
|
int x_close(), x_clear(), x_paintr(), x_errout(), |
65 |
< |
x_getcur(), x_comout(), x_comin(); |
65 |
> |
x_getcur(), x_comout(), x_comin(), x_flush(); |
66 |
|
|
67 |
|
static struct driver x_driver = { |
68 |
|
x_close, x_clear, x_paintr, x_getcur, |
69 |
< |
x_comout, x_comin, 1.0 |
69 |
> |
x_comout, x_comin, x_flush, 1.0 |
70 |
|
}; |
71 |
|
|
72 |
|
|
175 |
|
COLOR col; |
176 |
|
int xmin, ymin, xmax, ymax; |
177 |
|
{ |
184 |
– |
extern long nrays; /* global ray count */ |
178 |
|
extern int xnewcolr(); /* pixel assignment routine */ |
186 |
– |
static long lastflush = 0; /* ray count at last flush */ |
179 |
|
|
180 |
|
if (ncolors > 0) { |
181 |
|
XPixSet(gwind, xmin, gheight-ymax, xmax-xmin, ymax-ymin, |
182 |
|
pixval[get_pixel(col, xnewcolr)]); |
183 |
|
} |
184 |
< |
if (nrays - lastflush >= WFLUSH) { |
185 |
< |
if (ncolors <= 0) /* output necessary for death */ |
186 |
< |
XPixSet(gwind,0,0,1,1,BlackPixel); |
187 |
< |
checkinp(); |
188 |
< |
lastflush = nrays; |
189 |
< |
} |
184 |
> |
} |
185 |
> |
|
186 |
> |
|
187 |
> |
static |
188 |
> |
x_flush() /* flush output */ |
189 |
> |
{ |
190 |
> |
if (ncolors <= 0) /* output necessary for death */ |
191 |
> |
XPixSet(gwind,0,0,1,1,BlackPixel); |
192 |
> |
while (XPending() > 0) |
193 |
> |
getevent(); |
194 |
> |
|
195 |
|
} |
196 |
|
|
197 |
|
|