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.10 by gregl, Thu Jan 1 13:00:15 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) *
170 >        if (!qtAllocLeaves(DisplayWidth(ourdisplay,ourscreen) *
171                          DisplayHeight(ourdisplay,ourscreen) /
172                          (qtMinNodesiz*qtMinNodesiz)))
173                  error(SYSTEM, "insufficient memory for value storage");
# Line 262 | Line 266 | dev_flush()                    /* flush output */
266   {
267          qtUpdate();
268          glFlush();
269 +        rayqleft = RAYQLEN;
270          return(XPending(ourdisplay));
271   }
272  
# Line 314 | Line 319 | mytmflags()                    /* figure out tone mapping flags */
319          for (cp = tail; *cp && *cp != '.'; cp++)
320                  ;
321          if (cp-tail == 3 && !strncmp(tail, "glx", 3))
322 <                return(TM_F_CAMERA);
322 >                return(TM_F_CAMERA|TM_F_NOSTDERR);
323          if (cp-tail == 4 && !strncmp(tail, "glxh", 4))
324 <                return(TM_F_HUMAN);
324 >                return(TM_F_HUMAN|TM_F_NOSTDERR);
325          error(USER, "illegal driver name");
326   }
327  
# Line 567 | Line 572 | register XKeyPressedEvent  *ekey;
572                  inpresflags |= DFL(DC_RESUME);
573                  return;
574          case CTRL('R'):                 /* redraw screen */
575 +                if (nxtzmax > FTINY) {
576 +                        curzmax = nxtzmax;
577 +                        nxtzmax = 0.;
578 +                }
579                  glClear(GL_DEPTH_BUFFER_BIT);
580                  qtRedraw(0, 0, odev.hres, odev.vres);
581                  return;
582          case CTRL('L'):                 /* refresh from server */
583                  if (inpresflags & DFL(DC_REDRAW))
584                          return;
585 +                if (nxtzmax > FTINY) {
586 +                        curzmax = nxtzmax;
587 +                        nxtzmax = 0.;
588 +                }
589                  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
590                  draw_grids();
591                  glFlush();
# Line 627 | Line 640 | static
640   resizewindow(ersz)                      /* resize window */
641   register XConfigureEvent  *ersz;
642   {
643 +        glViewport(0, 0, ersz->width, ersz->height);
644 +
645          if (ersz->width == odev.hres && ersz->height == odev.vres)
646                  return;
647  
# Line 635 | Line 650 | register XConfigureEvent  *ersz;
650  
651          odev.v.horiz = 2.*180./PI * atan(0.5/VIEWDIST*pwidth*odev.hres);
652          odev.v.vert = 2.*180./PI * atan(0.5/VIEWDIST*pheight*odev.vres);
638
639        glViewport(0, 0, odev.hres, odev.vres);
653  
654          inpresflags |= DFL(DC_SETVIEW);
655   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines