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 2.3 by greg, Fri May 29 15:42:49 1992 UTC vs.
Revision 2.4 by greg, Sat May 30 09:32:18 1992 UTC

# Line 1 | Line 1
1 + /* Copyright (c) 1992 Regents of the University of California */
2 +
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
5   #endif
6  
5 /* Copyright (c) 1989 Regents of the University of California */
6
7   /*
8 < *  x11.c - driver for X-windows version 11.3
8 > *  x11.c - driver for X-windows version 11
9   *
10   *     Jan 1990
11   */
# Line 94 | Line 94 | char  *name, *id;
94          }
95                                          /* find a usable visual */
96          nplanes = DisplayPlanes(ourdisplay, ourscreen);
97 <        if (    !XMatchVisualInfo(ourdisplay,ourscreen,
98 <                        24,TrueColor,&ourvinfo) &&
99 <                !XMatchVisualInfo(ourdisplay,ourscreen,
100 <                        24,DirectColor,&ourvinfo)       ) {
97 >        if (XMatchVisualInfo(ourdisplay,ourscreen,
98 >                                24,TrueColor,&ourvinfo) ||
99 >                        XMatchVisualInfo(ourdisplay,ourscreen,
100 >                                24,DirectColor,&ourvinfo)) {
101 >                ourblack = 0;
102 >                ourwhite = ourvinfo.red_mask |
103 >                                ourvinfo.green_mask |
104 >                                ourvinfo.blue_mask ;
105 >        } else {
106                  if (nplanes < 4) {
107                          stderr_v("not enough colors\n");
108                          return(NULL);
109 <                } else if (!XMatchVisualInfo(ourdisplay,ourscreen,
109 >                }
110 >                if (!XMatchVisualInfo(ourdisplay,ourscreen,
111                                          nplanes,PseudoColor,&ourvinfo) &&
112                                  !XMatchVisualInfo(ourdisplay,ourscreen,
113                                          nplanes,GrayScale,&ourvinfo)) {
# Line 110 | Line 116 | char  *name, *id;
116                  }
117                  ourblack = BlackPixel(ourdisplay,ourscreen);
118                  ourwhite = WhitePixel(ourdisplay,ourscreen);
113        } else {
114                ourblack = 0;
115                ourwhite = ~0;
119          }
120          make_gmap(GAMMA);
121          /* open window */
122          ourwinattr.background_pixel = ourblack;
123          ourwinattr.border_pixel = ourblack;
124 <                                        /* this is a waste! */
124 >                                        /* this is stupid */
125          ourwinattr.colormap = XCreateColormap(ourdisplay, ourroot,
126                                  ourvinfo.visual, AllocNone);
127          gwind = XCreateWindow(ourdisplay, ourroot, 0, 0,
# Line 130 | Line 133 | char  *name, *id;
133                  stderr_v("cannot create window\n");
134                  return(NULL);
135          }
136 <        XStoreName(ourdisplay, gwind, id);
136 >        XFreeColormap(ourdisplay, ourwinattr.colormap);
137 >        XStoreName(ourdisplay, gwind, id);
138          /* create a cursor */
139          pickcursor = XCreateFontCursor(ourdisplay, XC_diamond_cross);
140          ourgc = XCreateGC(ourdisplay, gwind, 0, NULL);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines