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

Comparing ray/src/hd/rhd_ogl.c (file contents):
Revision 3.31 by greg, Thu Sep 6 00:07:43 2012 UTC vs.
Revision 3.33 by greg, Fri Oct 5 19:19:16 2018 UTC

# Line 129 | Line 129 | static void freedepth(void);
129   static double getdistance(int dx, int dy, FVECT direc);
130   static int mytmflags(void);
131   static void getevent(void);
132 < static void draw3dline(register FVECT wp[2]);
132 > static void draw3dline(FVECT wp[2]);
133   static void draw_grids(int fore);
134   static int moveview(int dx, int dy, int mov, int orb);
135   static void getframe(XButtonPressedEvent *ebut);
136   static void getmove(XButtonPressedEvent *ebut);
137 < static void getkey(register XKeyPressedEvent *ekey);
138 < static void fixwindow(register XExposeEvent *eexp);
139 < static void resizewindow(register XConfigureEvent *ersz);
137 > static void getkey(XKeyPressedEvent *ekey);
138 > static void fixwindow(XExposeEvent *eexp);
139 > static void resizewindow(XConfigureEvent *ersz);
140   static void waitabit(void);
141   static void setglpersp(void);
142   static void setglortho(void);
# Line 153 | Line 153 | extern int     gmPortals;      /* GL portal list id */
153   extern time_t   time();
154  
155  
156 < extern void
156 > void
157   dev_open(id)                    /* initialize GLX driver */
158   char  *id;
159   {
# Line 286 | Line 286 | char  *id;
286   }
287  
288  
289 < extern void
289 > void
290   dev_close(void)                 /* close our display and free resources */
291   {
292   #ifdef DOBJ
# Line 309 | Line 309 | dev_close(void)                        /* close our display and free resour
309   }
310  
311  
312 < extern void
312 > void
313   dev_clear(void)                 /* clear our representation */
314   {
315          viewflags |= VWCHANGE;          /* pretend our view has changed */
# Line 319 | Line 319 | dev_clear(void)                        /* clear our representation */
319   }
320  
321  
322 < extern int
322 > int
323   dev_view(                       /* assign new driver view */
324 <        register VIEW   *nv
324 >        VIEW    *nv
325   )
326   {
327   #ifdef STEREO
# Line 376 | Line 376 | dev_view(                      /* assign new driver view */
376   }
377  
378  
379 < extern void
379 > void
380   dev_section(            /* add octree for geometry rendering */
381          char    *gfn,
382          char    *pfn
# Line 401 | Line 401 | dev_section(           /* add octree for geometry rendering */
401   }
402  
403  
404 < extern void
404 > void
405   dev_auxcom(             /* process an auxiliary command */
406          char    *cmd,
407          char    *args
# Line 423 | Line 423 | dev_auxcom(            /* process an auxiliary command */
423   }
424  
425  
426 < extern VIEW *
426 > VIEW *
427   dev_auxview(            /* return nth auxiliary view */
428          int     n,
429          int     hvres[2]
# Line 440 | Line 440 | dev_auxview(           /* return nth auxiliary view */
440   }
441  
442  
443 < extern int
443 > int
444   dev_input(void)                 /* get X11 input */
445   {
446          inpresflags = 0;
# Line 456 | Line 456 | dev_input(void)                        /* get X11 input */
456   }
457  
458  
459 < extern void
459 > void
460   dev_value(              /* add a pixel value to our texture */
461          COLR    c,
462          FVECT   d,
# Line 475 | Line 475 | dev_value(             /* add a pixel value to our texture */
475   }
476  
477  
478 < extern int
478 > int
479   dev_flush(void)                 /* flush output as appropriate */
480   {
481          int     ndrawn;
# Line 527 | Line 527 | checkglerr(            /* check for GL or GLU error */
527          char    *where
528   )
529   {
530 <        register GLenum errcode;
530 >        GLenum  errcode;
531  
532          while ((errcode = glGetError()) != GL_NO_ERROR) {
533                  sprintf(errmsg, "OpenGL error %s: %s",
# Line 540 | Line 540 | checkglerr(            /* check for GL or GLU error */
540   static void
541   xferdepth(void)                 /* load and clear depth buffer */
542   {
543 <        register GLfloat        *dbp;
544 <        register GLubyte        *pbuf;
543 >        GLfloat *dbp;
544 >        GLubyte *pbuf;
545  
546          if (depthbuffer == NULL) {      /* allocate private depth buffer */
547   #ifdef STEREO
# Line 677 | Line 677 | static int
677   mytmflags(void)                 /* figure out tone mapping flags */
678   {
679          extern char     *progname;
680 <        register char   *cp, *tail;
680 >        char    *cp, *tail;
681                                          /* find basic name */
682          for (cp = tail = progname; *cp; cp++)
683                  if (*cp == '/')
# Line 720 | Line 720 | getevent(void)                 /* get next event */
720                  getkey(levptr(XKeyPressedEvent));
721                  break;
722          case ButtonPress:
723 <                if (FRAMESTATE(levptr(XButtonPressedEvent)->state))
724 <                        getframe(levptr(XButtonPressedEvent));
723 >                if (FRAMESTATE(levptr(XButtonPressedEvent)->state))
724 >                        getframe(levptr(XButtonPressedEvent));
725                  else
726 <                        getmove(levptr(XButtonPressedEvent));
726 >                        switch (levptr(XButtonPressedEvent)->button) {
727 >                        case Button4:           /* wheel up */
728 >                        case Button5:           /* wheel down */
729 >                                break;
730 >                        default:
731 >                                getmove(levptr(XButtonPressedEvent));
732 >                                break;
733 >                        }
734                  break;
735          }
736   }
# Line 731 | Line 738 | getevent(void)                 /* get next event */
738  
739   static void
740   draw3dline(                     /* draw 3d line in world coordinates */
741 <        register FVECT  wp[2]
741 >        FVECT   wp[2]
742   )
743   {
744          glVertex3d(wp[0][0], wp[0][1], wp[0][2]);
# Line 851 | Line 858 | getframe(                              /* get focus frame */
858                                                  /* set frame for rendering */
859          if ((endx == startx) | (endy == starty))
860                  return;
861 <        if (endx < startx) {register int c = endx; endx = startx; startx = c;}
862 <        if (endy < starty) {register int c = endy; endy = starty; starty = c;}
861 >        if (endx < startx) {int c = endx; endx = startx; startx = c;}
862 >        if (endy < starty) {int c = endy; endy = starty; starty = c;}
863          sprintf(odev_args, "%.3f %.3f %.3f %.3f",
864                          (startx+.5)/odev.hres, 1.-(endy+.5)/odev.vres,
865                          (endx+.5)/odev.hres, 1.-(starty+.5)/odev.vres);
# Line 1032 | Line 1039 | wipeclean(void)                        /* prepare for redraw */
1039  
1040   static void
1041   getkey(                         /* get input key */
1042 <        register XKeyPressedEvent  *ekey
1042 >        XKeyPressedEvent  *ekey
1043   )
1044   {
1045          Window  rootw, childw;
# Line 1116 | Line 1123 | getkey(                                /* get input key */
1123  
1124   static void
1125   fixwindow(                              /* repair damage to window */
1126 <        register XExposeEvent  *eexp
1126 >        XExposeEvent  *eexp
1127   )
1128   {
1129          int     xmin, ymin, xmax, ymax;
# Line 1162 | Line 1169 | fixwindow(                             /* repair damage to window */
1169  
1170   static void
1171   resizewindow(                   /* resize window */
1172 <        register XConfigureEvent  *ersz
1172 >        XConfigureEvent  *ersz
1173   )
1174   {
1175          glViewport(0, 0, ersz->width, ersz->height);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines