--- ray/src/hd/rhd_x11.c 1998/01/01 14:48:46 3.21 +++ ray/src/hd/rhd_x11.c 1998/01/06 13:07:57 3.24 @@ -96,8 +96,10 @@ dev_open(id) /* initialize X11 driver */ char *id; { extern char *getenv(); - char *gv; + static RGBPRIMS myprims = STDPRIMS; + char *ev; double gamval = GAMMA; + RGBPRIMP dpri = stdprims; int nplanes; XSetWindowAttributes ourwinattr; XWMHints ourxwmhints; @@ -130,10 +132,17 @@ char *id; ourwhite = WhitePixel(ourdisplay,ourscreen); } /* set gamma and tone mapping */ - if ((gv = XGetDefault(ourdisplay, "radiance", "gamma")) != NULL - || (gv = getenv("DISPLAY_GAMMA")) != NULL) - gamval = atof(gv); - if (tmInit(mytmflags(), stdprims, gamval) == NULL) + if ((ev = XGetDefault(ourdisplay, "radiance", "gamma")) != NULL + || (ev = getenv("DISPLAY_GAMMA")) != NULL) + gamval = atof(ev); + if ((ev = getenv("DISPLAY_PRIMARIES")) != NULL && + sscanf(ev, "%f %f %f %f %f %f %f %f", + &myprims[RED][CIEX],&myprims[RED][CIEY], + &myprims[GRN][CIEX],&myprims[GRN][CIEY], + &myprims[BLU][CIEX],&myprims[BLU][CIEY], + &myprims[WHT][CIEX],&myprims[WHT][CIEY]) >= 6) + dpri = myprims; + if (tmInit(mytmflags(), dpri, gamval) == NULL) error(SYSTEM, "not enough memory in dev_open"); /* open window */ ourwinattr.background_pixel = ourblack; @@ -199,6 +208,16 @@ dev_close() /* close our display */ } + +dev_clear() /* clear our quadtree */ +{ + qtCompost(100); + if (ncolors > 0) + new_ctab(ncolors); + rayqleft = 0; /* hold off update */ +} + + int dev_view(nv) /* assign new driver view */ VIEW *nv; @@ -604,6 +623,7 @@ register XKeyPressedEvent *ekey; if (ncolors > 0) new_ctab(ncolors); inpresflags |= DFL(DC_REDRAW); /* resend values from server */ + rayqleft = 0; /* hold off update */ return; case 'K': /* kill rtrace process(es) */ inpresflags |= DFL(DC_KILL);