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.7 by greg, Fri Feb 23 14:50:38 1990 UTC vs.
Revision 1.8 by greg, Thu Mar 1 08:22:44 1990 UTC

# Line 85 | Line 85 | char  *name, *id;
85          int  nplanes;
86          XVisualInfo  ourvinfo;
87          XWMHints  ourxwmhints;
88        Pixmap  bmCursorSrc, bmCursorMsk;
88  
89          ourdisplay = XOpenDisplay(NULL);
90          if (ourdisplay == NULL) {
# Line 152 | Line 151 | x11_close()                    /* close our display */
151                  xt_close(comline);
152                  comline = NULL;
153          }
154 <        if (gwind != 0) {
155 <                freepixels();
156 <                XFreeGC(ourdisplay, ourgc);
157 <                XDestroyWindow(ourdisplay, gwind);
158 <                gwind = 0;
160 <                ourgc = 0;
161 <        }
154 >        freepixels();
155 >        XFreeGC(ourdisplay, ourgc);
156 >        XDestroyWindow(ourdisplay, gwind);
157 >        gwind = 0;
158 >        ourgc = 0;
159          XFreeCursor(ourdisplay, pickcursor);
160          XCloseDisplay(ourdisplay);
161          ourdisplay = NULL;
# Line 184 | Line 181 | int  xres, yres;
181                  XSelectInput(ourdisplay, comline->w, ExposureMask);
182                  gwidth = xres;
183                  gheight = yres;
184 <                XSync(ourdisplay, 1);           /* discard input */
184 >                XFlush(ourdisplay);
185                  sleep(2);                       /* wait for window manager */
186 +                XSync(ourdisplay, 1);           /* discard input */
187          }
188          XClearWindow(ourdisplay, gwind);
189          if (ourvisual->class == PseudoColor)    /* reinitialize color table */
# Line 223 | Line 221 | int  xmin, ymin, xmax, ymax;
221   static
222   x11_flush()                     /* flush output */
223   {
224 <        if (ncolors <= 0)       /* output necessary for death */
224 >        if (ncolors <= 0 && ourvisual->class != TrueColor)      /* dummy */
225                  XFillRectangle(ourdisplay, gwind, ourgc, 0, 0, 1 ,1);
226          while (XPending(ourdisplay) > 0)
227                  getevent();
# Line 253 | Line 251 | char  *out;
251   {
252          if (comline != NULL)
253                  xt_puts(out, comline);
256        XFlush(ourdisplay);
254   }
255  
256  
# Line 375 | Line 372 | freepixels()                           /* free our pixels */
372                  return;
373          XFreeColors(ourdisplay,ourmap,pixval,ncolors,0L);
374          ncolors = 0;
375 <        if (ourmap != 0 && ourmap != DefaultColormap(ourdisplay,ourscreen))
375 >        if (ourmap != DefaultColormap(ourdisplay,ourscreen))
376                  XFreeColormap(ourdisplay, ourmap);
377          ourmap = 0;
378   }
# Line 442 | Line 439 | static
439   getkey(ekey)                            /* get input key */
440   register XKeyPressedEvent  *ekey;
441   {
442 <        int  n;
442 >        register int  n;
443  
444          n = XLookupString(ekey, c_queue+c_last, sizeof(c_queue)-c_last,
445                                  NULL, NULL);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines