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

Comparing ray/src/hd/rhd_x11.c (file contents):
Revision 3.31 by gwlarson, Fri Dec 18 11:56:10 1998 UTC vs.
Revision 3.34 by schorsch, Mon Jul 21 22:30:18 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   * X11 driver for holodeck display.
6   * Based on rview driver.
# Line 13 | Line 10 | static char SCCSid[] = "$SunId$ SGI";
10   #include  <X11/Xlib.h>
11   #include  <X11/cursorfont.h>
12   #include  <X11/Xutil.h>
13 + #include  <time.h>
14   #include "rhd_qtree.h"
15   #include  "x11icon.h"
16  
# Line 178 | Line 176 | char  *id;
176                          DisplayWidth(ourdisplay, ourscreen);
177          pheight = (double)DisplayHeightMM(ourdisplay, ourscreen) /
178                          DisplayHeight(ourdisplay, ourscreen);
179 <        copystruct(&odev.v, &stdview);
179 >        odev.v = stdview;
180          odev.v.type = VT_PER;
181                                          /* map the window and get its size */
182          XMapWindow(ourdisplay, gwind);
# Line 260 | Line 258 | VIEW   *nv;
258                          XResizeWindow(ourdisplay, gwind, odev.hres, odev.vres);
259                          dev_input();    /* wait for resize event */
260                  }
261 <                copystruct(&odev.v, nv);
261 >                odev.v = *nv;
262          }
263          qtReplant();
264          return(1);
# Line 377 | Line 375 | loop:
375                          return(ncolors = 0);
376                  if (XAllocColorCells(ourdisplay,ourmap,0,NULL,0,pixval,ncolors))
377                          break;
378 <                free((char *)pixval);
378 >                free((void *)pixval);
379                  pixval = NULL;
380          }
381          if (pixval == NULL) {
# Line 412 | Line 410 | freepixels()                           /* free our pixels */
410          if (ncolors == 0)
411                  return;
412          XFreeColors(ourdisplay,ourmap,pixval,ncolors,0L);
413 <        free((char *)pixval);
413 >        free((void *)pixval);
414          pixval = NULL;
415          ncolors = 0;
416          if (ourmap != DefaultColormap(ourdisplay,ourscreen))
# Line 548 | Line 546 | int    dx, dy, mov, orb;
546          double  d;
547          register int    li;
548                                  /* start with old view */
549 <        copystruct(&nv, &odev.v);
549 >        nv = odev.v;
550                                  /* change view direction */
551          if (mov | orb) {
552                  if ((li = qtFindLeaf(dx, dy)) < 0)
# Line 611 | Line 609 | XButtonPressedEvent    *ebut;
609  
610  
611   static
612 + waitabit()                              /* pause a moment */
613 + {
614 +        struct timespec ts;
615 +        ts.tv_sec = 0;
616 +        ts.tv_nsec = 50000000;
617 +        nanosleep(&ts, NULL);
618 + }
619 +
620 +
621 + static
622   getmove(ebut)                           /* get view change */
623   XButtonPressedEvent     *ebut;
624   {
# Line 626 | Line 634 | XButtonPressedEvent    *ebut;
634  
635          while (!XCheckMaskEvent(ourdisplay,
636                          ButtonReleaseMask, levptr(XEvent))) {
637 <
637 >                waitabit();
638                  if (!XQueryPointer(ourdisplay, gwind, &rootw, &childw,
639                                  &rootx, &rooty, &wx, &wy, &statemask))
640                          break;          /* on another screen */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines