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.12 by gwlarson, Fri Jan 29 15:28:36 1999 UTC vs.
Revision 3.14 by greg, Mon May 19 16:32:19 2003 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   */
# Line 14 | Line 11 | static char SCCSid[] = "$SunId$ SGI";
11   #include <X11/extensions/SGIStereo.h>
12   #endif
13   #include <ctype.h>
14 + #include <time.h>
15   #include "radogl.h"
16   #include "view.h"
17   #include "paths.h"
# Line 92 | Line 90 | int    displist;                       /* our scene display list */
90  
91   int     no_render = 0;                  /* don't rerender */
92  
93 < #ifdef BSD
96 < #define strchr          index
97 < #endif
98 <
99 < extern char     *strchr(), *fgets(), *fgetline(), *atos(), *scan4var();
93 > extern char     *fgetline(), *atos(), *scan4var();
94   extern int      nowarn;                 /* turn warnings off? */
101 extern time_t   time();
95  
96  
97   main(argc, argv)
# Line 180 | Line 173 | userr:
173   }
174  
175  
176 + void
177   quit(code)                              /* exit gracefully */
178   int     code;
179   {
# Line 626 | Line 620 | int    dx, dy, mov, orb;
620   }
621  
622  
623 + static
624 + waitabit()                              /* pause a moment */
625 + {
626 +        struct timespec ts;
627 +        ts.tv_sec = 0;
628 +        ts.tv_nsec = 5000000;
629 +        nanosleep(&ts, NULL);
630 + }
631 +
632 +
633   getmove(ebut)                           /* get view change */
634   XButtonPressedEvent     *ebut;
635   {
# Line 642 | Line 646 | XButtonPressedEvent    *ebut;
646  
647          while (!XCheckMaskEvent(ourdisplay,
648                          ButtonReleaseMask, levptr(XEvent))) {
649 +                                        /* pause so as not to move too fast */
650 +                waitabit();
651  
652                  if (!XQueryPointer(ourdisplay, gwind, &rootw, &childw,
653                                  &rootx, &rooty, &wx, &wy, &statemask))
# Line 677 | Line 683 | double md;
683          if (md <= FTINY) md = FHUGE;
684          fbuf[3] = dir[0]*md; fbuf[4] = dir[1]*md; fbuf[5] = dir[2]*md;
685                                  /* trace that ray */
686 <        if (process(rtpd, fbuf, fbuf, 4*sizeof(float), 6*sizeof(float)) !=
687 <                        4*sizeof(float))
686 >        if (process(rtpd, (char *)fbuf, (char *)fbuf,
687 >                        4*sizeof(float), 6*sizeof(float)) != 4*sizeof(float))
688                  error(INTERNAL, "error getting data back from rtrace process");
689          if (fbuf[3] >= .99*FHUGE)
690                  return(0);      /* missed local objects */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines