1 |
< |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
1 |
> |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ SGI"; |
265 |
|
} |
266 |
|
|
267 |
|
|
268 |
+ |
dev_auxcom(cmd, args) /* process an auxiliary command */ |
269 |
+ |
char *cmd, *args; |
270 |
+ |
{ |
271 |
+ |
sprintf(errmsg, "%s: unknown command", cmd); |
272 |
+ |
error(COMMAND, errmsg); |
273 |
+ |
} |
274 |
+ |
|
275 |
+ |
|
276 |
+ |
VIEW * |
277 |
+ |
dev_auxview(n, hvres) /* return nth auxiliary view */ |
278 |
+ |
int n; |
279 |
+ |
int hvres[2]; |
280 |
+ |
{ |
281 |
+ |
if (n) |
282 |
+ |
return(NULL); |
283 |
+ |
hvres[0] = odev.hres; hvres[1] = odev.vres; |
284 |
+ |
return(&odev.v); |
285 |
+ |
} |
286 |
+ |
|
287 |
+ |
|
288 |
|
int |
289 |
|
dev_input() /* get X11 input */ |
290 |
|
{ |
293 |
|
do |
294 |
|
getevent(); |
295 |
|
|
296 |
< |
while (XQLength(ourdisplay) > 0); |
296 |
> |
while (XPending(ourdisplay) > 0); |
297 |
|
|
298 |
+ |
odev.inpready = 0; |
299 |
+ |
|
300 |
|
return(inpresflags); |
301 |
|
} |
302 |
|
|
324 |
|
{ |
325 |
|
qtUpdate(); |
326 |
|
rayqleft = RAYQLEN; |
327 |
< |
return(XPending(ourdisplay)); |
327 |
> |
return(odev.inpready = XPending(ourdisplay)); |
328 |
|
} |
329 |
|
|
330 |
|
|
464 |
|
int dp[2][2]; |
465 |
|
FVECT wp[2]; |
466 |
|
{ |
467 |
< |
static FVECT vmin = {0.,0.,0.}, vmax = {1.,1.,FHUGE}; |
468 |
< |
FVECT ip[2]; |
469 |
< |
/* not exactly right, but who cares? */ |
470 |
< |
viewloc(ip[0], &odev.v, wp[0]); |
471 |
< |
viewloc(ip[1], &odev.v, wp[1]); |
467 |
> |
static FVECT vmin = {0.,0.,0.}, vmax = {1.-FTINY,1.-FTINY,FHUGE}; |
468 |
> |
FVECT wpc[2], ip[2]; |
469 |
> |
double d, d0, d1; |
470 |
> |
/* check for points behind view */ |
471 |
> |
d = DOT(odev.v.vp, odev.v.vdir); |
472 |
> |
d0 = DOT(wp[0], odev.v.vdir) - d; |
473 |
> |
d1 = DOT(wp[1], odev.v.vdir) - d; |
474 |
> |
/* work on copy of world points */ |
475 |
> |
if (d0 <= d1) { |
476 |
> |
VCOPY(wpc[0], wp[0]); VCOPY(wpc[1], wp[1]); |
477 |
> |
} else { |
478 |
> |
d = d0; d0 = d1; d1 = d; |
479 |
> |
VCOPY(wpc[1], wp[0]); VCOPY(wpc[0], wp[1]); |
480 |
> |
} |
481 |
> |
if (d0 <= FTINY) { |
482 |
> |
if (d1 <= FTINY) return(0); |
483 |
> |
VSUB(wpc[0], wpc[0], wpc[1]); |
484 |
> |
d = .99*d1/(d1-d0); |
485 |
> |
VSUM(wpc[0], wpc[1], wpc[0], d); |
486 |
> |
} |
487 |
> |
/* get view coordinates and clip to window */ |
488 |
> |
viewloc(ip[0], &odev.v, wpc[0]); |
489 |
> |
viewloc(ip[1], &odev.v, wpc[1]); |
490 |
|
if (!clip(ip[0], ip[1], vmin, vmax)) |
491 |
|
return(0); |
492 |
|
dp[0][0] = ip[0][0]*odev.hres; |
517 |
|
static BYTE gridrgb[3] = {0x0, 0xff, 0xff}; |
518 |
|
unsigned long pixel; |
519 |
|
|
480 |
– |
if (!mapped) |
481 |
– |
return; |
520 |
|
if (ncolors > 0) |
521 |
|
pixel = pixval[get_pixel(gridrgb, xnewcolr)]; |
522 |
|
else |