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

Comparing ray/src/hd/rhdisp.c (file contents):
Revision 3.3 by gregl, Fri Nov 21 15:11:43 1997 UTC vs.
Revision 3.7 by gregl, Wed Nov 26 20:13:34 1997 UTC

# Line 17 | Line 17 | HOLO   *hdlist[HDMAX+1];       /* global holodeck list */
17  
18   int     imm_mode = 0;           /* bundles are being delivered immediately */
19  
20 VIEW    dvw;                    /* our current display view */
21
20   char    *progname;              /* global argv[0] */
21  
22 < #define SERV_READY      01
23 < #define DEV_READY       02
22 > #define RDY_SRV 01
23 > #define RDY_DEV 02
24  
25  
26   main(argc, argv)
# Line 39 | Line 37 | char   *argv[];
37                                          /* enter main loop */
38          do {
39                  rdy = disp_wait();
40 <                if (rdy & DEV_READY) {          /* get user input */
40 >                if (rdy & RDY_DEV) {            /* get user input */
41                          inp = dev_input();
42                          if (inp & DEV_NEWVIEW)
43                                  new_view(&odev.v);
44                          if (inp & DEV_SHUTDOWN)
45                                  serv_request(DR_SHUTDOWN, 0, NULL);
46 +                        if (inp & DEV_REDRAW) {
47 +                                imm_mode = 1;   /* preempt updates */
48 +                                beam_sync();
49 +                        }
50                          if (inp & DEV_WAIT)
51                                  pause = 1;
52                          if (inp & DEV_RESUME) {
# Line 52 | Line 54 | char   *argv[];
54                                  pause = 0;
55                          }
56                  }
57 <                if (rdy & SERV_READY) {         /* get server result */
57 >                if (rdy & RDY_SRV) {            /* get server result */
58                          res = serv_result();
59                          if (pause && res != DS_SHUTDOWN) {
60                                  serv_request(DR_ATTEN, 0, NULL);
# Line 76 | Line 78 | disp_wait()                    /* wait for more input */
78          register int    i;
79                                  /* see if we can avoid select call */
80          if (imm_mode || stdin->_cnt > 0)
81 <                return(SERV_READY);
81 >                return(RDY_SRV);
82          if (dev_flush())
83 <                return(DEV_READY);
83 >                return(RDY_DEV);
84                                  /* make the call */
85          FD_ZERO(&readset); FD_ZERO(&errset);
86          FD_SET(0, &readset);
# Line 94 | Line 96 | disp_wait()                    /* wait for more input */
96          }
97          flgs = 0;               /* flag what's ready */
98          if (FD_ISSET(0, &readset) || FD_ISSET(0, &errset))
99 <                flgs |= SERV_READY;
99 >                flgs |= RDY_SRV;
100          if (FD_ISSET(odev.ifd, &readset) || FD_ISSET(odev.ifd, &errset))
101 <                flgs |= DEV_READY;
101 >                flgs |= RDY_DEV;
102          return(flgs);
103   }
104  
# Line 159 | Line 161 | VIEW   *v;
161          if ((err = setview(v)) != NULL)
162                  error(INTERNAL, err);
163          dev_view(v);                    /* update display driver */
164 <        beam_view(&dvw, v);             /* update beam list */
165 <        copystruct(&dvw, v);            /* record new view */
164 >        dev_flush();                    /* update screen */
165 >        beam_view(v);                   /* update beam list */
166   }
167  
168  
# Line 201 | Line 203 | serv_result()                  /* get next server result and process
203          case DS_STARTIMM:
204          case DS_ENDIMM:
205                  imm_mode = msg.type==DS_STARTIMM;
206 +                if (msg.type == DS_ENDIMM)
207 +                        dev_flush();            /* update display NOW */
208                  /* fall through */
209          case DS_ACKNOW:
210          case DS_SHUTDOWN:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines