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.5 by gregl, Fri Dec 26 14:46:21 1997 UTC vs.
Revision 3.12 by gregl, Thu Jan 1 16:28:44 1998 UTC

# Line 16 | Line 16 | static char SCCSid[] = "$SunId$ SGI";
16  
17   #include  "x11icon.h"
18  
19 + #ifndef RAYQLEN
20 + #define RAYQLEN         50000           /* max. rays to queue before flush */
21 + #endif
22 +
23   #ifndef FEQ
24   #define FEQ(a,b)        ((a)-(b) <= FTINY && (a)-(b) >= -FTINY)
25   #endif
# Line 100 | Line 104 | char  *id;
104          XSizeHints      oursizhints;
105                                          /* set quadtree globals */
106          qtMinNodesiz = 3;
107 +        qtDepthEps = 0.07;
108                                          /* open display server */
109          ourdisplay = XOpenDisplay(NULL);
110          if (ourdisplay == NULL)
# Line 161 | Line 166 | char  *id;
166                                          /* map the window */
167          XMapWindow(ourdisplay, gwind);
168          dev_input();                    /* sets size and view angles */
164        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
169                                          /* allocate our leaf pile */
170 <        if (!qtAllocLeaves(2 * DisplayWidth(ourdisplay,ourscreen) *
171 <                        DisplayHeight(ourdisplay,ourscreen) /
172 <                        (qtMinNodesiz*qtMinNodesiz)))
170 >        if (!qtAllocLeaves(DisplayWidth(ourdisplay,ourscreen) *
171 >                        DisplayHeight(ourdisplay,ourscreen) * 3 /
172 >                        (qtMinNodesiz*qtMinNodesiz*2)))
173                  error(SYSTEM, "insufficient memory for value storage");
174          odev.name = id;
175          odev.ifd = ConnectionNumber(ourdisplay);
# Line 262 | Line 266 | dev_flush()                    /* flush output */
266   {
267          qtUpdate();
268          glFlush();
269 +        rayqleft = RAYQLEN;
270          return(XPending(ourdisplay));
271   }
272  
# Line 273 | Line 278 | double rad;
278   {
279          register int    ci, j;
280          double  apexh, basez;
281 +                                        /* is window mapped? */
282 +        if (!mapped)
283 +                return;
284                                          /* compute apex height (0. to 1.) */
285          if (ip[2] > 1e6)
286                  apexh = 1. - 1./DEPTHFACT;
# Line 314 | Line 322 | mytmflags()                    /* figure out tone mapping flags */
322          for (cp = tail; *cp && *cp != '.'; cp++)
323                  ;
324          if (cp-tail == 3 && !strncmp(tail, "glx", 3))
325 <                return(TM_F_CAMERA);
325 >                return(TM_F_CAMERA|TM_F_NOSTDERR);
326          if (cp-tail == 4 && !strncmp(tail, "glxh", 4))
327 <                return(TM_F_HUMAN);
327 >                return(TM_F_HUMAN|TM_F_NOSTDERR);
328          error(USER, "illegal driver name");
329   }
330  
# Line 567 | Line 575 | register XKeyPressedEvent  *ekey;
575                  inpresflags |= DFL(DC_RESUME);
576                  return;
577          case CTRL('R'):                 /* redraw screen */
578 +                if (nxtzmax > FTINY) {
579 +                        curzmax = nxtzmax;
580 +                        nxtzmax = 0.;
581 +                }
582                  glClear(GL_DEPTH_BUFFER_BIT);
583                  qtRedraw(0, 0, odev.hres, odev.vres);
584                  return;
585          case CTRL('L'):                 /* refresh from server */
586                  if (inpresflags & DFL(DC_REDRAW))
587                          return;
588 +                if (nxtzmax > FTINY) {
589 +                        curzmax = nxtzmax;
590 +                        nxtzmax = 0.;
591 +                }
592                  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
593                  draw_grids();
594                  glFlush();
# Line 627 | Line 643 | static
643   resizewindow(ersz)                      /* resize window */
644   register XConfigureEvent  *ersz;
645   {
646 +        glViewport(0, 0, ersz->width, ersz->height);
647 +
648          if (ersz->width == odev.hres && ersz->height == odev.vres)
649                  return;
650  
# Line 635 | Line 653 | register XConfigureEvent  *ersz;
653  
654          odev.v.horiz = 2.*180./PI * atan(0.5/VIEWDIST*pwidth*odev.hres);
655          odev.v.vert = 2.*180./PI * atan(0.5/VIEWDIST*pheight*odev.vres);
638
639        glViewport(0, 0, odev.hres, odev.vres);
656  
657          inpresflags |= DFL(DC_SETVIEW);
658   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines