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

Comparing ray/src/util/glrad.c (file contents):
Revision 3.4 by gwlarson, Wed Jun 10 17:52:18 1998 UTC vs.
Revision 3.8 by gwlarson, Wed Jul 8 18:00:39 1998 UTC

# Line 33 | Line 33 | static char SCCSid[] = "$SunId$ SGI";
33   #define MOVDEG          (-5)            /* degrees to orbit CW/down /frame */
34   #define MOVORB(s)       ((s)&ShiftMask ? 1 : (s)&ControlMask ? -1 : 0)
35  
36 #define MINWIDTH        480             /* minimum graphics window width */
37 #define MINHEIGHT       400             /* minimum graphics window height */
38
36   #define BORWIDTH        5               /* border width */
37  
38   #define  ourscreen      DefaultScreen(ourdisplay)
# Line 93 | Line 90 | int    stereo = 0;                     /* do stereo? */
90  
91   int     displist;                       /* our scene display list */
92  
93 < int     in_dev_view = 0;                /* currently in dev_view() */
93 > int     no_render = 0;                  /* don't rerender */
94  
95   #ifdef BSD
96   #define strchr          index
# Line 176 | Line 173 | char   *argv[];
173                                          /* all done */
174          quit(0);
175   userr:
176 <        fprintf(stderr, "Usage: %s [-w][-b][-v view] rfile [VAR=value]..\n",
176 >        fprintf(stderr,
177 >                "Usage: %s [-w][-s][-b][-S][-v view] rfile [VAR=value]..\n",
178                          argv[0]);
179          quit(1);
180   }
# Line 374 | Line 372 | char  *id;
372                                  GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE,15, None};
373          XSetWindowAttributes    ourwinattr;
374          XWMHints        ourxwmhints;
377        XSizeHints      oursizhints;
375                                          /* open display server */
376          ourdisplay = XOpenDisplay(NULL);
377          if (ourdisplay == NULL)
# Line 421 | Line 418 | char  *id;
418          ourxwmhints.icon_pixmap = XCreateBitmapFromData(ourdisplay,
419                  gwind, glradicon_bits, glradicon_width, glradicon_height);
420          XSetWMHints(ourdisplay, gwind, &ourxwmhints);
424        oursizhints.min_width = MINWIDTH;
425        oursizhints.min_height = stereo ? MINHEIGHT/2 : MINHEIGHT;
426        oursizhints.flags = PMinSize;
427        XSetNormalHints(ourdisplay, gwind, &oursizhints);
421                                          /* set GLX context */
422          glXMakeCurrent(ourdisplay, gwind, gctx);
423          glEnable(GL_DEPTH_TEST);
424          glDepthFunc(GL_LESS);
425          glShadeModel(GL_SMOOTH);
426          glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
427 <        glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
427 >        glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
428          glEnable(GL_LIGHTING);
429          if (backvis)
430                  glDisable(GL_CULL_FACE);
# Line 452 | Line 445 | char  *id;
445          }
446                                          /* map the window */
447          XMapWindow(ourdisplay, gwind);
448 +        no_render++;
449          do
450                  dev_input(0);           /* get resize event */
451          while (hres == 0 & vres == 0);
452 +        no_render--;
453          rgl_checkerr("initializing GLX");
454   }
455  
# Line 505 | Line 500 | register VIEW  *nv;
500                          }
501                  }
502                  if (newhres != hres | newvres != vres) {
503 <                        in_dev_view++;
503 >                        no_render++;
504                          XResizeWindow(ourdisplay, gwind, newhres, newvres);
505                          do
506                                  dev_input(0);           /* get resize event */
507                          while (newhres != hres | newvres != vres);
508 <                        in_dev_view--;
508 >                        no_render--;
509                  }
510          }
511          copystruct(&thisview, nv);
# Line 564 | Line 559 | render()                       /* render our display list and swap buffers
559   {
560          double  d;
561  
562 <        if (!mapped)
562 >        if (!mapped | no_render)
563                  return;
564          glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
565          glCallList(displist);
# Line 815 | Line 810 | int    vwnum;
810                          ;
811          else if (vwnum >= MAXVIEW || vwl[vwnum].v == NULL)
812                  vwnum = 0;
818        if (vwnum == currentview)
819                return;
813          copylastv("standard view");
814          dev_view(vwl[currentview=vwnum].v);
815   }
# Line 890 | Line 883 | register XConfigureEvent  *ersz;
883          glViewport(0, 0, hres=ersz->width, vres=ersz->height);
884          if (hres > maxhres) maxhres = hres;
885          if (vres > maxvres) maxvres = vres;
886 <        if (in_dev_view)
886 >        if (no_render)
887                  return;
888          wa = (vres*pheight)/(hres*pwidth);
889          va = viewaspect(&thisview);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines