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

Comparing ray/src/hd/rhd_glx.c (file contents):
Revision 3.19 by gwlarson, Wed Aug 19 17:45:58 1998 UTC vs.
Revision 3.20 by gwlarson, Thu Aug 20 09:32:52 1998 UTC

# Line 272 | Line 272 | register VIEW  *nv;
272                  nv->vert = odev.v.vert;
273                  return(0);
274          }
275 <        if (nv != &odev.v) {
276 <                if (!FEQ(nv->horiz,odev.v.horiz) ||     /* resize window? */
277 <                                !FEQ(nv->vert,odev.v.vert)) {
278 <                        int     dw = DisplayWidth(ourdisplay,ourscreen);
279 <                        int     dh = DisplayHeight(ourdisplay,ourscreen);
275 >        if (nv != &odev.v &&                    /* resize window? */
276 >                        (!FEQ(nv->horiz,odev.v.horiz) ||
277 >                                !FEQ(nv->vert,odev.v.vert))) {
278 >                int     dw = DisplayWidth(ourdisplay,ourscreen);
279 >                int     dh = DisplayHeight(ourdisplay,ourscreen);
280  
281 <                        dw -= 25;       /* for window frame */
282 <                        dh -= 50;
281 >                dw -= 25;       /* for window frame */
282 >                dh -= 50;
283   #ifdef STEREO
284 <                        dh /= 2;
284 >                dh /= 2;
285   #endif
286 <                        odev.hres = 2.*VIEWDIST/pwidth *
287 <                                        tan(PI/180./2.*nv->horiz);
288 <                        odev.vres = 2.*VIEWDIST/pheight *
289 <                                        tan(PI/180./2.*nv->vert);
290 <                        if (odev.hres > dw) {
291 <                                odev.vres = dw * odev.vres / odev.hres;
292 <                                odev.hres = dw;
293 <                        }
294 <                        if (odev.vres > dh) {
295 <                                odev.hres = dh * odev.hres / odev.vres;
296 <                                odev.vres = dh;
297 <                        }
298 <                        XResizeWindow(ourdisplay, gwind, odev.hres, odev.vres);
299 <                        dev_input();    /* get resize event */
286 >                odev.hres = 2.*VIEWDIST/pwidth *
287 >                                tan(PI/180./2.*nv->horiz);
288 >                odev.vres = 2.*VIEWDIST/pheight *
289 >                                tan(PI/180./2.*nv->vert);
290 >                if (odev.hres > dw) {
291 >                        odev.vres = dw * odev.vres / odev.hres;
292 >                        odev.hres = dw;
293                  }
294 <                copystruct(&odev.v, nv);        /* setview() already called */
295 <                setglpersp(&odev.v);
294 >                if (odev.vres > dh) {
295 >                        odev.hres = dh * odev.hres / odev.vres;
296 >                        odev.vres = dh;
297 >                }
298 >                XResizeWindow(ourdisplay, gwind, odev.hres, odev.vres);
299 >                dev_input();    /* get resize event */
300 >        }
301 >        copystruct(&odev.v, nv);        /* setview() already called */
302 >        setglpersp(&odev.v);
303   #ifdef STEREO
304 <                copystruct(&vwright, nv);
305 <                d = eyesepdist / sqrt(nv->hn2);
306 <                VSUM(vwright.vp, nv->vp, nv->hvec, d);
307 <                /* setview(&vwright);   -- Unnecessary */
304 >        copystruct(&vwright, nv);
305 >        d = eyesepdist / sqrt(nv->hn2);
306 >        VSUM(vwright.vp, nv->vp, nv->hvec, d);
307 >        /* setview(&vwright);   -- Unnecessary */
308   #endif
309 <                checkglerr("setting view");
310 <        }
309 >        checkglerr("setting view");
310          wipeclean();
311          return(1);
312   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines