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.19 by gregl, Wed Dec 24 16:56:00 1997 UTC

# Line 158 | Line 158 | char  *id;
158          oursizhints.min_height = MINHEIGHT;
159          oursizhints.flags = PMinSize;
160          XSetNormalHints(ourdisplay, gwind, &oursizhints);
161 +                                        /* figure out sensible view */
162 +        pwidth = (double)DisplayWidthMM(ourdisplay, ourscreen) /
163 +                        DisplayWidth(ourdisplay, ourscreen);
164 +        pheight = (double)DisplayHeightMM(ourdisplay, ourscreen) /
165 +                        DisplayHeight(ourdisplay, ourscreen);
166 +        copystruct(&odev.v, &stdview);
167 +        odev.v.type = VT_PER;
168                                          /* map the window and get its size */
169          XMapWindow(ourdisplay, gwind);
170 <        dev_input();
170 >        dev_input();                    /* sets size and view angles */
171                                          /* allocate our leaf pile */
172          if (!qtAllocLeaves(DisplayWidth(ourdisplay,ourscreen) *
173                          DisplayHeight(ourdisplay,ourscreen) /
174                          (qtMinNodesiz*qtMinNodesiz)))
175                  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);
176          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);
177          odev.ifd = ConnectionNumber(ourdisplay);
178   }
179  
# Line 236 | Line 233 | VIEW   *nv;
233                                  odev.vres = dh;
234                          }
235                          XResizeWindow(ourdisplay, gwind, odev.hres, odev.vres);
236 +                        dev_input();    /* wait for resize event */
237                  }
238                  copystruct(&odev.v, nv);
239          }
# Line 455 | Line 453 | draw_grids()                   /* draw holodeck section grids */
453          static BYTE     gridrgb[3] = {0x0, 0xff, 0xff};
454          unsigned long  pixel;
455  
456 <        if (!mapped || odev.v.type != VT_PER)
456 >        if (!mapped)
457                  return;
458          if (ncolors > 0)
459                  pixel = pixval[get_pixel(gridrgb, xnewcolr)];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines