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.28 by gwlarson, Thu Jun 10 15:22:21 1999 UTC vs.
Revision 3.31 by greg, Fri Sep 19 18:33:04 2003 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1999 Silicon Graphics, Inc. */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * OpenGL GLX driver for holodeck display.
6   * Based on old GLX driver using cones.
# Line 226 | Line 223 | char  *id;
223          setstereobuf(STEREO_BUFFER_LEFT);
224   #endif
225          checkglerr("setting rendering parameters");
226 <        copystruct(&odev.v, &stdview);
226 >        odev.v = stdview;
227          odev.v.type = VT_PER;
228                                          /* map the window */
229          XMapWindow(ourdisplay, gwind);
# Line 309 | Line 306 | register VIEW  *nv;
306                          XResizeWindow(ourdisplay, gwind, odev.hres, odev.vres);
307                          dev_input();    /* get resize event */
308                  }
309 <                copystruct(&odev.v, nv);        /* setview() already called */
309 >                odev.v = *nv;   /* setview() already called */
310          }
311   #ifdef STEREO
312 <        copystruct(&vwright, nv);
312 >        vwright = *nv;
313          d = eyesepdist / sqrt(nv->hn2);
314          VSUM(vwright.vp, nv->vp, nv->hvec, d);
315          /* setview(&vwright);   -- Unnecessary */
# Line 546 | Line 543 | FVECT  direc;
543          if (dx<0 | dx>=odev.hres | dy<0 | dy>=odev.vres)
544                  return(FHUGE);
545          glReadPixels(dx,dy, 1,1, GL_DEPTH_COMPONENT,GL_FLOAT, &gldepth);
546 +        if (gldepth <= FTINY)
547 +                return (FHUGE); /* call failed */
548          dist = mapdepth(gldepth);
549          if (dist >= .99*FHUGE)
550                  return(FHUGE);
# Line 562 | Line 561 | int    dx, dy, mov, orb;
561          double  d,d1;
562          register int    li;
563                                  /* start with old view */
564 <        copystruct(&nv, &odev.v);
564 >        nv = odev.v;
565                                  /* orient our motion */
566          if (viewray(v1, odir, &odev.v,
567                          (dx+.5)/odev.hres, (dy+.5)/odev.vres) < -FTINY)
# Line 737 | Line 736 | register VIEW  *vp;
736                  dev_zmin = odev.v.vfore;
737          if (odev.v.vaft > FTINY)
738                  dev_zmax = odev.v.vaft;
739 <        if (dev_zmin < dev_zmax/500.)
740 <                dev_zmin = dev_zmax/500.;
739 >        if (dev_zmin*500. < dev_zmax)
740 >                dev_zmax = dev_zmin*500.;
741          xmax = dev_zmin * tan(PI/180./2. * odev.v.horiz);
742          xmin = -xmax;
743          d = odev.v.hoff * (xmax - xmin);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines