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.20 by greg, Sun Jul 24 19:53:08 2005 UTC

# Line 1 | Line 1
1 /* Copyright (c) 1998 Silicon Graphics, Inc. */
2
1   #ifndef lint
2 < static char SCCSid[] = "$SunId$ SGI";
2 > static const char       RCSid[] = "$Id$";
3   #endif
6
4   /*
5   * Program to display Radiance scene using OpenGL.
6   */
7  
11 #include "radogl.h"
12 #include "view.h"
13 #include "paths.h"
8   #include <sys/types.h>
9   #include <GL/glx.h>
10   #ifndef NOSTEREO
11   #include <X11/extensions/SGIStereo.h>
12   #endif
13   #include <ctype.h>
14 + #include <string.h>
15 + #include <time.h>
16 +
17 + #include "radogl.h"
18 + #include "view.h"
19 + #include "paths.h"
20   #include "glradicon.h"
21 + #include "rtprocess.h"
22  
23   #ifndef MAXVIEW
24   #define MAXVIEW         63              /* maximum number of standard views */
# Line 33 | Line 34 | static char SCCSid[] = "$SunId$ SGI";
34   #define MOVDEG          (-5)            /* degrees to orbit CW/down /frame */
35   #define MOVORB(s)       ((s)&ShiftMask ? 1 : (s)&ControlMask ? -1 : 0)
36  
36 #define MINWIDTH        480             /* minimum graphics window width */
37 #define MINHEIGHT       400             /* minimum graphics window height */
38
37   #define BORWIDTH        5               /* border width */
38  
39   #define  ourscreen      DefaultScreen(ourdisplay)
# Line 77 | Line 75 | char   *scene[MAXSCENE+1];             /* material and scene file l
75   int     nscenef = 0;                    /* number of scene files */
76   char    *octree;                        /* octree name (NULL if unnec.) */
77  
78 < int     rtpd[3];                        /* rtrace process descriptors */
78 > SUBPROC rtpd;                   /* rtrace process descriptors */
79  
80   int     silent = 0;                     /* run rad silently? */
81   int     backvis = 1;                    /* back faces visible? */
82   int     stereo = 0;                     /* do stereo? */
83  
84   #ifdef NOSTEREO
85 < #define setstereobuf(bid)       0
85 > #define setstereobuf(bid)      
86   #else
87   #define setstereobuf(bid)       (glXWaitGL(), \
88                                  XSGISetStereoBuffer(ourdisplay, gwind, bid), \
# Line 93 | Line 91 | int    stereo = 0;                     /* do stereo? */
91  
92   int     displist;                       /* our scene display list */
93  
94 < int     in_dev_view = 0;                /* currently in dev_view() */
94 > int     no_render = 0;                  /* don't rerender */
95  
98 #ifdef BSD
99 #define strchr          index
100 #endif
101
102 extern char     *strchr(), *fgets(), *fgetline(), *atos(), *scan4var();
96   extern int      nowarn;                 /* turn warnings off? */
104 extern time_t   time();
97  
98 + static void startrtrace(char    *octname);
99 + static void runrad(int  ac, char        **av);
100 + static int findvw(register char *nm);
101 + static int varmatch(register char       *s, register char       *vn);
102 + static char * scan4var(char     *buf, int       buflen, char    *vname, FILE    *fp);
103 + static void dev_open(char  *id);
104 + static void dev_close(void);
105 + static int dev_view(register VIEW       *nv);
106 + static int dev_input(int        nsecs);
107 + static void render(void);
108 + static int moveview(int dx, int dy, int mov, int        orb);
109 + static void waitabit(void);
110 + static void getmove(XButtonPressedEvent *ebut);
111 + static int getintersect(FVECT   wp, FVECT       org, FVECT      dir, double     md);
112 + static void setglpersp(register VIEW    *vp);
113 + static int getkey(register XKeyPressedEvent  *ekey);
114 + static void zoomview(int        pct, int        dx, int dy);
115 + static void gotoview(int        vwnum);
116 + static void appendview(char     *nm, VIEW       *vp);
117 + static void copylastv(char      *cause);
118 + static void fixwindow(register XExposeEvent  *eexp);
119 + static void resizewindow(register XConfigureEvent  *ersz);
120  
121 < main(argc, argv)
122 < int     argc;
123 < char    *argv[];
121 >
122 > int
123 > main(
124 >        int     argc,
125 >        char    *argv[]
126 > )
127   {
128          char    *viewsel = NULL;
129          long    vwintvl = 0;
# Line 145 | Line 162 | char   *argv[];
162                                          /* run rad and get views */
163          runrad(argc-i, argv+i);
164                                          /* check view */
165 <        if (viewsel != NULL)
165 >        if (viewsel != NULL) {
166                  if (viewsel[0] == '-') {
167                          char    *ve = viewsel;
168                          if (!sscanview(&thisview, viewsel) ||
# Line 160 | Line 177 | char   *argv[];
177                                                  progname, viewsel);
178                          quit(1);
179                  }
180 +        }
181                                          /* open GL */
182          dev_open(radfile = argv[i]);
183                                          /* load octree or scene files */
184          if (octree != NULL) {
185 <                displist = rgl_octlist(octree, NULL, NULL);
185 >                displist = rgl_octlist(octree, NULL, NULL, NULL);
186                  startrtrace(octree);
187          } else
188 <                displist = rgl_filelist(nscenef, scene);
188 >                displist = rgl_filelist(nscenef, scene, NULL);
189                                          /* set initial view */
190          dev_view(currentview < 0 ? &thisview : vwl[currentview].v);
191                                          /* input/render loop */
# Line 176 | Line 194 | char   *argv[];
194                                          /* all done */
195          quit(0);
196   userr:
197 <        fprintf(stderr, "Usage: %s [-w][-b][-v view] rfile [VAR=value]..\n",
197 >        fprintf(stderr,
198 >                "Usage: %s [-w][-s][-b][-S][-v view] rfile [VAR=value]..\n",
199                          argv[0]);
200          quit(1);
201 +        return 1; /* pro forma return */
202   }
203  
204  
205 < quit(code)                              /* exit gracefully */
206 < int     code;
205 > void
206 > quit(                           /* exit gracefully */
207 >        int     code
208 > )
209   {
210          if (ourdisplay != NULL)
211                  dev_close();
212 <        if (rtpd[2] > 0) {
213 <                if (close_process(rtpd) > 0)
212 >        /* if (rtpd.pid > 0) { */
213 >        if (rtpd.running) {
214 >                if (close_process(&rtpd) > 0)
215                          wputs("bad exit status from rtrace\n");
216 <                rtpd[2] = 0;
216 >                /* rtpd.pid = 0; */
217          }
218          exit(code);
219   }
220  
221  
222 < startrtrace(octname)                    /* start rtrace on octname */
223 < char    *octname;
222 > static void
223 > startrtrace(                    /* start rtrace on octname */
224 >        char    *octname
225 > )
226   {
227          static char     *av[12] = {"rtrace", "-h", "-fff", "-ld+",
228                                          "-opL", "-x", "1"};
# Line 206 | Line 231 | char   *octname;
231          if (nowarn) av[ac++] = "-w-";
232          av[ac++] = octname;
233          av[ac] = NULL;
234 <        if (open_process(rtpd, av) <= 0)
234 >        if (open_process(&rtpd, av) <= 0)
235                  error(SYSTEM, "cannot start rtrace process");
236   }
237  
238  
239 < runrad(ac, av)                          /* run rad and load variables */
240 < int     ac;
241 < char    **av;
239 > static void
240 > runrad(                         /* run rad and load variables */
241 >        int     ac,
242 >        char    **av
243 > )
244   {
245          static char     optfile[] = TEMPLATE;
246          int     nvn = 0, nvv = 0;
247          FILE    *fp;
221        int     cval;
248          register char   *cp;
249          char    radcomm[256], buf[128], nam[32];
250                                          /* set rad commmand */
# Line 246 | Line 272 | char   **av;
272                                                  /* get exposure */
273          if ((cp = scan4var(buf, sizeof(buf), "EXPOSURE", fp)) != NULL) {
274                  expval = atof(cp);
275 <                if (*cp == '-' | *cp == '+')
275 >                if ((*cp == '-') | (*cp == '+'))
276                          expval = pow(2., expval);
277                  expval *= 0.5;          /* compensate for local shading */
278          }
# Line 278 | Line 304 | char   **av;
304          do
305                  if (isview(buf)) {
306                          vwl[nvv].v = (VIEW *)bmalloc(sizeof(VIEW));
307 <                        copystruct(vwl[nvv].v, &stdview);
307 >                        *(vwl[nvv].v) = stdview;
308                          sscanview(vwl[nvv].v, buf);
309                          if ((cp = setview(vwl[nvv++].v)) != NULL) {
310                                  fprintf(stderr, "%s: bad view %d - %s\n",
# Line 300 | Line 326 | char   **av;
326                                          atof(sskip2(buf+4,1)),
327                                          atof(sskip2(buf+4,2)));
328                  else if (backvis && !strncmp(buf, "-bv", 3) &&
329 <                                (!buf[3] || strchr(" 0-FfNn", buf[3]) != NULL))
329 >                                (!buf[3] || strchr("0-FfNn \n",buf[3])!=NULL))
330                          backvis = 0;
331          fclose(fp);
332          unlink(optfile);                        /* delete options file */
333   }
334  
335  
336 < int
337 < findvw(nm)                      /* find named view */
338 < register char   *nm;
336 > static int
337 > findvw(                 /* find named view */
338 >        register char   *nm
339 > )
340   {
341          register int    n;
342  
343 <        if (*nm >= '1' & *nm <= '9' &&
343 >        if ((*nm >= '1') & (*nm <= '9') &&
344                          (n = atoi(nm)-1) <= MAXVIEW && vwl[n].v != NULL)
345                  return(n);
346          for (n = 0; vwl[n].v != NULL; n++)
# Line 323 | Line 350 | register char  *nm;
350   }
351  
352  
353 < int
354 < varmatch(s, vn)                         /* match line to variable */
355 < register char   *s, *vn;
353 > static int
354 > varmatch(                               /* match line to variable */
355 >        register char   *s,
356 >        register char   *vn
357 > )
358   {
359          register int    c;
360  
# Line 341 | Line 370 | register char  *s, *vn;
370   }
371  
372  
373 < char *
374 < scan4var(buf, buflen, vname, fp)        /* scan for variable from fp */
375 < char    *buf;
376 < int     buflen;
377 < char    *vname;
378 < FILE    *fp;
373 > static char *
374 > scan4var(       /* scan for variable from fp */
375 >        char    *buf,
376 >        int     buflen,
377 >        char    *vname,
378 >        FILE    *fp
379 > )
380   {
381          int     cval;
382          register char   *cp;
# Line 366 | Line 396 | FILE   *fp;
396   }
397  
398  
399 < dev_open(id)                    /* initialize GLX driver */
400 < char  *id;
399 > static void
400 > dev_open(                       /* initialize GLX driver */
401 >        char  *id
402 > )
403   {
404          static int      atlBest[] = {GLX_RGBA, GLX_RED_SIZE,4,
405                                  GLX_GREEN_SIZE,4, GLX_BLUE_SIZE,4,
406                                  GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE,15, None};
407          XSetWindowAttributes    ourwinattr;
408          XWMHints        ourxwmhints;
377        XSizeHints      oursizhints;
409                                          /* open display server */
410          ourdisplay = XOpenDisplay(NULL);
411          if (ourdisplay == NULL)
# Line 418 | Line 449 | char  *id;
449                                          /* set window manager hints */
450          ourxwmhints.flags = InputHint|IconPixmapHint;
451          ourxwmhints.input = True;
452 <        ourxwmhints.icon_pixmap = XCreateBitmapFromData(ourdisplay,
453 <                gwind, glradicon_bits, glradicon_width, glradicon_height);
452 >        ourxwmhints.icon_pixmap = XCreateBitmapFromData(ourdisplay, gwind,
453 >                (char *)glradicon_bits, glradicon_width, glradicon_height);
454          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);
455                                          /* set GLX context */
456          glXMakeCurrent(ourdisplay, gwind, gctx);
457          glEnable(GL_DEPTH_TEST);
458          glDepthFunc(GL_LESS);
459          glShadeModel(GL_SMOOTH);
460          glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
461 <        glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
461 >        glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
462          glEnable(GL_LIGHTING);
463 +        glFrontFace(GL_CCW);
464 +        glCullFace(GL_BACK);
465          if (backvis)
466                  glDisable(GL_CULL_FACE);
467 <        else {
439 <                glFrontFace(GL_CCW);
440 <                glCullFace(GL_BACK);
467 >        else
468                  glEnable(GL_CULL_FACE);
442        }
469          glDrawBuffer(GL_BACK);
470                                          /* figure out sensible view */
471          pwidth = (double)DisplayWidthMM(ourdisplay, ourscreen) /
# Line 452 | Line 478 | char  *id;
478          }
479                                          /* map the window */
480          XMapWindow(ourdisplay, gwind);
481 +        no_render++;
482          do
483                  dev_input(0);           /* get resize event */
484 <        while (hres == 0 & vres == 0);
484 >        while ((hres == 0) & (vres == 0));
485 >        no_render--;
486          rgl_checkerr("initializing GLX");
487   }
488  
489  
490 < dev_close()                     /* close our display and free resources */
490 > static void
491 > dev_close(void)                 /* close our display and free resources */
492   {
493          glXMakeCurrent(ourdisplay, None, NULL);
494          glXDestroyContext(ourdisplay, gctx);
# Line 470 | Line 499 | dev_close()                    /* close our display and free resources
499   }
500  
501  
502 < int
503 < dev_view(nv)                    /* assign new driver view */
504 < register VIEW   *nv;
502 > static int
503 > dev_view(                       /* assign new driver view */
504 >        register VIEW   *nv
505 > )
506   {
507          int     newhres = hres, newvres = vres;
508          double  wa, va;
# Line 481 | Line 511 | register VIEW  *nv;
511                  error(COMMAND, "illegal view type");
512                  nv->type = VT_PER;
513          }
514 <        if (nv->horiz > 160. | nv->vert > 160.) {
514 >        if ((nv->horiz > 160.) | (nv->vert > 160.)) {
515                  error(COMMAND, "illegal view angle");
516                  if (nv->horiz > 160.)
517                          nv->horiz = 160.;
518                  if (nv->vert > 160.)
519                          nv->vert = 160.;
520          }
521 <        if (hres != 0 & vres != 0) {
521 >        if ((hres != 0) & (vres != 0)) {
522                  wa = (vres*pheight)/(hres*pwidth);
523                  va = viewaspect(nv);
524                  if (va > wa+.05) {
# Line 504 | Line 534 | register VIEW  *nv;
534                                  newvres = (pwidth/pheight)*va*newhres + .5;
535                          }
536                  }
537 <                if (newhres != hres | newvres != vres) {
538 <                        in_dev_view++;
537 >                if ((newhres != hres) | (newvres != vres)) {
538 >                        no_render++;
539                          XResizeWindow(ourdisplay, gwind, newhres, newvres);
540                          do
541                                  dev_input(0);           /* get resize event */
542 <                        while (newhres != hres | newvres != vres);
543 <                        in_dev_view--;
542 >                        while ((newhres != hres) | (newvres != vres));
543 >                        no_render--;
544                  }
545          }
546 <        copystruct(&thisview, nv);
546 >        thisview = *nv;
547          setglpersp(&thisview);
548          render();
549          return(1);
550   }
551  
552  
553 < int
554 < dev_input(nsecs)                /* get next input event */
555 < int     nsecs;
553 > static int
554 > dev_input(              /* get next input event */
555 >        int     nsecs
556 > )
557   {
558   #if 0
559          static time_t   lasttime = 0;
# Line 560 | Line 591 | int    nsecs;
591   }
592  
593  
594 < render()                        /* render our display list and swap buffers */
594 > static void
595 > render(void)                    /* render our display list and swap buffers */
596   {
597          double  d;
598  
599 <        if (!mapped)
599 >        if (!mapped | no_render)
600                  return;
601          glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
602          glCallList(displist);
# Line 586 | Line 618 | render()                       /* render our display list and swap buffers
618   }
619  
620  
621 < moveview(dx, dy, mov, orb)      /* move our view */
622 < int     dx, dy, mov, orb;
621 > static int
622 > moveview(       /* move our view */
623 >        int     dx,
624 >        int     dy,
625 >        int     mov,
626 >        int     orb
627 > )
628   {
629          VIEW    nv;
630          FVECT   odir, v1, wp;
631          double  d;
595        register int    li;
632                                  /* start with old view */
633 <        copystruct(&nv, &thisview);
633 >        nv = thisview;
634                                  /* change view direction */
635          if ((d = viewray(v1, odir, &thisview,
636                          (dx+.5)/hres, (dy+.5)/vres)) < -FTINY)
# Line 632 | Line 668 | int    dx, dy, mov, orb;
668   }
669  
670  
671 < getmove(ebut)                           /* get view change */
672 < XButtonPressedEvent     *ebut;
671 > static void
672 > waitabit(void)                          /* pause a moment */
673   {
674 +        struct timespec ts;
675 +        ts.tv_sec = 0;
676 +        ts.tv_nsec = 5000000;
677 +        nanosleep(&ts, NULL);
678 + }
679 +
680 +
681 + static void
682 + getmove(                                /* get view change */
683 +        XButtonPressedEvent     *ebut
684 + )
685 + {
686          int     movdir = MOVDIR(ebut->button);
687          int     movorb = MOVORB(ebut->state);
688          int     moved = 0;
# Line 648 | Line 696 | XButtonPressedEvent    *ebut;
696  
697          while (!XCheckMaskEvent(ourdisplay,
698                          ButtonReleaseMask, levptr(XEvent))) {
699 +                                        /* pause so as not to move too fast */
700 +                waitabit();
701  
702                  if (!XQueryPointer(ourdisplay, gwind, &rootw, &childw,
703                                  &rootx, &rooty, &wx, &wy, &statemask))
# Line 668 | Line 718 | XButtonPressedEvent    *ebut;
718   }
719  
720  
721 < getintersect(wp, org, dir, md)          /* intersect ray with scene geometry */
722 < FVECT   wp;             /* returned world intersection point */
723 < FVECT   org, dir;
724 < double  md;
721 > static int
722 > getintersect(           /* intersect ray with scene geometry */
723 >        FVECT   wp,             /* returned world intersection point */
724 >        FVECT   org,
725 >        FVECT   dir,
726 >        double  md
727 > )
728   {
729          float   fbuf[6];
730                                  /* check to see if rtrace is running */
731 <        if (rtpd[2] <= 0)
731 >        /* if (rtpd.pid <= 0) */
732 >        if (!rtpd.running)
733                  return(0);
734                                  /* assign origin */
735          fbuf[0] = org[0]; fbuf[1] = org[1]; fbuf[2] = org[2];
# Line 683 | Line 737 | double md;
737          if (md <= FTINY) md = FHUGE;
738          fbuf[3] = dir[0]*md; fbuf[4] = dir[1]*md; fbuf[5] = dir[2]*md;
739                                  /* trace that ray */
740 <        if (process(rtpd, fbuf, fbuf, 4*sizeof(float), 6*sizeof(float)) !=
741 <                        4*sizeof(float))
740 >        if (process(&rtpd, (char *)fbuf, (char *)fbuf,
741 >                        4*sizeof(float), 6*sizeof(float)) != 4*sizeof(float))
742                  error(INTERNAL, "error getting data back from rtrace process");
743          if (fbuf[3] >= .99*FHUGE)
744                  return(0);      /* missed local objects */
# Line 693 | Line 747 | double md;
747   }
748  
749  
750 < setglpersp(vp)                  /* set perspective view in GL */
751 < register VIEW   *vp;
750 > static void
751 > setglpersp(                     /* set perspective view in GL */
752 >        register VIEW   *vp
753 > )
754   {
755          double  d, xmin, xmax, ymin, ymax, zmin, zmax;
756  
# Line 725 | Line 781 | register VIEW  *vp;
781   }
782  
783  
784 < int
785 < getkey(ekey)                            /* get input key */
786 < register XKeyPressedEvent  *ekey;
784 > static int
785 > getkey(                         /* get input key */
786 >        register XKeyPressedEvent  *ekey
787 > )
788   {
789          int  n;
790          char    buf[8];
# Line 745 | Line 802 | register XKeyPressedEvent  *ekey;
802          case 'l':                       /* retrieve last (premouse) view */
803                  if (lastview.type) {
804                          VIEW    vtmp;
805 <                        copystruct(&vtmp, &thisview);
805 >                        vtmp = thisview;
806                          dev_view(&lastview);
807 <                        copystruct(&lastview, &vtmp);
807 >                        lastview = vtmp;
808                  } else
809                          XBell(ourdisplay, 0);
810                  break;
# Line 781 | Line 838 | register XKeyPressedEvent  *ekey;
838   }
839  
840  
841 < zoomview(pct, dx, dy)                   /* zoom in or out around (dx,dy) */
842 < int     pct;
843 < int     dx, dy;
841 > static void
842 > zoomview(                       /* zoom in or out around (dx,dy) */
843 >        int     pct,
844 >        int     dx,
845 >        int     dy
846 > )
847   {
848          double  h, v;
789        FVECT   direc;
849  
850 <        if (pct == 100 | pct <= 0)
850 >        if ((pct == 100) | (pct <= 0))
851                  return;
852          copylastv("zooming");
853          h = (dx+.5)/hres - 0.5;
# Line 807 | Line 866 | int    dx, dy;
866   }
867  
868  
869 < gotoview(vwnum)                         /* go to specified view number */
870 < int     vwnum;
869 > static void
870 > gotoview(                               /* go to specified view number */
871 >        int     vwnum
872 > )
873   {
874          if (vwnum < 0)
875                  for (vwnum = currentview; vwl[vwnum+1].v != NULL; vwnum++)
876                          ;
877          else if (vwnum >= MAXVIEW || vwl[vwnum].v == NULL)
878                  vwnum = 0;
818        if (vwnum == currentview)
819                return;
879          copylastv("standard view");
880          dev_view(vwl[currentview=vwnum].v);
881   }
882  
883  
884 < appendview(nm, vp)                      /* append standard view */
885 < char    *nm;
886 < VIEW    *vp;
884 > static void
885 > appendview(                     /* append standard view */
886 >        char    *nm,
887 >        VIEW    *vp
888 > )
889   {
890          FILE    *fp;
891                                          /* check if already in there */
892 <        if (!bcmp(&thisview, vwl[currentview].v, sizeof(VIEW))) {
892 >        if (!memcmp(&thisview, vwl[currentview].v, sizeof(VIEW))) {
893                  error(COMMAND, "view already in standard list");
894                  return;
895          }
# Line 849 | Line 910 | VIEW   *vp;
910          if (currentview >= MAXVIEW)
911                  error(INTERNAL, "too many views in appendview");
912          vwl[currentview].v = (VIEW *)bmalloc(sizeof(VIEW));
913 <        copystruct(vwl[currentview].v, &thisview);
913 >        *(vwl[currentview].v) = thisview;
914          if (nm != NULL)
915                  vwl[currentview].nam = savqstr(nm);
916   }
917  
918  
919 < copylastv(cause)                        /* copy last view position */
920 < char    *cause;
919 > static void
920 > copylastv(                      /* copy last view position */
921 >        char    *cause
922 > )
923   {
924          static char     *lastvc;
925  
926          if (cause == lastvc)
927                  return;                 /* only record one view per cause */
928          lastvc = cause;
929 <        copystruct(&lastview, &thisview);
929 >        lastview = thisview;
930   }
931  
932  
933 < fixwindow(eexp)                         /* repair damage to window */
934 < register XExposeEvent  *eexp;
933 > static void
934 > fixwindow(                              /* repair damage to window */
935 >        register XExposeEvent  *eexp
936 > )
937   {
938 <        if (hres == 0 | vres == 0) {    /* first exposure */
938 >        if ((hres == 0) | (vres == 0)) {        /* first exposure */
939                  resizewindow((XConfigureEvent *)eexp);
940                  return;
941          }
# Line 881 | Line 946 | register XExposeEvent  *eexp;
946   }
947  
948  
949 < resizewindow(ersz)                      /* resize window */
950 < register XConfigureEvent  *ersz;
949 > static void
950 > resizewindow(                   /* resize window */
951 >        register XConfigureEvent  *ersz
952 > )
953   {
954          static char     resizing[] = "resizing window";
955          double  wa, va;
# Line 890 | Line 957 | register XConfigureEvent  *ersz;
957          glViewport(0, 0, hres=ersz->width, vres=ersz->height);
958          if (hres > maxhres) maxhres = hres;
959          if (vres > maxvres) maxvres = vres;
960 <        if (in_dev_view)
960 >        if (no_render)
961                  return;
962          wa = (vres*pheight)/(hres*pwidth);
963          va = viewaspect(&thisview);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines