ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rhd_x11.c
(Generate patch)

Comparing ray/src/hd/rhd_x11.c (file contents):
Revision 3.17 by gregl, Fri Dec 19 14:44:58 1997 UTC vs.
Revision 3.20 by gregl, Thu Jan 1 13:00:15 1998 UTC

# Line 18 | Line 18 | static char SCCSid[] = "$SunId$ SGI";
18  
19   #include  "x11icon.h"
20  
21 + #ifndef RAYQLEN
22 + #define RAYQLEN         50000           /* max. rays to queue before flush */
23 + #endif
24 +
25   #ifndef FEQ
26   #define FEQ(a,b)        ((a)-(b) <= FTINY && (a)-(b) >= -FTINY)
27   #endif
# Line 81 | Line 85 | mytmflags()                    /* figure out tone mapping flags */
85          for (cp = tail; *cp && *cp != '.'; cp++)
86                  ;
87          if (cp-tail == 3 && !strncmp(tail, "x11", 3))
88 <                return(TM_F_CAMERA);
88 >                return(TM_F_CAMERA|TM_F_NOSTDERR);
89          if (cp-tail == 4 && !strncmp(tail, "x11h", 4))
90 <                return(TM_F_HUMAN);
90 >                return(TM_F_HUMAN|TM_F_NOSTDERR);
91          error(USER, "illegal driver name");
92   }
93  
# Line 158 | Line 162 | char  *id;
162          oursizhints.min_height = MINHEIGHT;
163          oursizhints.flags = PMinSize;
164          XSetNormalHints(ourdisplay, gwind, &oursizhints);
165 +                                        /* figure out sensible view */
166 +        pwidth = (double)DisplayWidthMM(ourdisplay, ourscreen) /
167 +                        DisplayWidth(ourdisplay, ourscreen);
168 +        pheight = (double)DisplayHeightMM(ourdisplay, ourscreen) /
169 +                        DisplayHeight(ourdisplay, ourscreen);
170 +        copystruct(&odev.v, &stdview);
171 +        odev.v.type = VT_PER;
172                                          /* map the window and get its size */
173          XMapWindow(ourdisplay, gwind);
174 <        dev_input();
174 >        dev_input();                    /* sets size and view angles */
175                                          /* allocate our leaf pile */
176          if (!qtAllocLeaves(DisplayWidth(ourdisplay,ourscreen) *
177                          DisplayHeight(ourdisplay,ourscreen) /
178                          (qtMinNodesiz*qtMinNodesiz)))
179                  error(SYSTEM, "insufficient memory for leaf storage");
169
170                                        /* figure out sensible view */
171        pwidth = (double)DisplayWidthMM(ourdisplay, ourscreen) /
172                        DisplayWidth(ourdisplay, ourscreen);
173        pheight = (double)DisplayHeightMM(ourdisplay, ourscreen) /
174                        DisplayHeight(ourdisplay, ourscreen);
175        copystruct(&odev.v, &stdview);
180          odev.name = id;
177        odev.v.type = VT_PER;
178        odev.v.horiz = 2.*180./PI * atan(0.5/VIEWDIST*pwidth*odev.hres);
179        odev.v.vert = 2.*180./PI * atan(0.5/VIEWDIST*pheight*odev.vres);
181          odev.ifd = ConnectionNumber(ourdisplay);
182   }
183  
# Line 236 | Line 237 | VIEW   *nv;
237                                  odev.vres = dh;
238                          }
239                          XResizeWindow(ourdisplay, gwind, odev.hres, odev.vres);
240 +                        dev_input();    /* wait for resize event */
241                  }
242                  copystruct(&odev.v, nv);
243          }
# Line 280 | Line 282 | int
282   dev_flush()                     /* flush output */
283   {
284          qtUpdate();
285 +        rayqleft = RAYQLEN;
286          return(XPending(ourdisplay));
287   }
288  
# Line 455 | Line 458 | draw_grids()                   /* draw holodeck section grids */
458          static BYTE     gridrgb[3] = {0x0, 0xff, 0xff};
459          unsigned long  pixel;
460  
461 <        if (!mapped || odev.v.type != VT_PER)
461 >        if (!mapped)
462                  return;
463          if (ncolors > 0)
464                  pixel = pixval[get_pixel(gridrgb, xnewcolr)];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines