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

Comparing ray/src/hd/rhd_glx1.c (file contents):
Revision 3.2 by schorsch, Mon Jul 21 22:30:18 2003 UTC vs.
Revision 3.3 by schorsch, Thu Jan 1 11:21:55 2004 UTC

# Line 9 | Line 9 | static const char      RCSid[] = "$Id$";
9   #include "standard.h"
10  
11   #include  <GL/glx.h>
12 + #include  <GL/glu.h>
13  
14   #include "rhd_qtree.h"
15 <
15 > #include "rhdriver.h"
16 > #include "rhdisp.h"
17   #include  "x11icon.h"
18  
19   #ifndef RAYQLEN
# Line 85 | Line 87 | static int     inpresflags;            /* input result flags */
87  
88   static int      headlocked = 0;         /* lock vertical motion */
89  
88 static int  resizewindow(), getevent(), getkey(), moveview(),
89                initcones(), freecones(),
90                getmove(), fixwindow(), mytmflags();
90  
91 + static int mytmflags(void);
92 + static void initcones(void);
93 + static void freecones(void);
94 + static void getevent(void);
95 + static void draw3dline(FVECT    wp[2]);
96 + static void draw_grids(void);
97 + static int moveview(int dx, int dy, int mov, int        orb);
98 + static void getmove(XButtonPressedEvent *ebut);
99 + static void getkey(XKeyPressedEvent  *ekey);
100 + static void fixwindow(XExposeEvent  *eexp);
101 + static void resizewindow(XConfigureEvent  *ersz);
102  
103 < dev_open(id)                    /* initialize X11 driver */
104 < char  *id;
103 >
104 > extern void
105 > dev_open(
106 >        char  *id
107 > )
108   {
109          extern char     *getenv();
110          static RGBPRIMS myprims = STDPRIMS;
# Line 187 | Line 200 | char  *id;
200   }
201  
202  
203 < dev_close()                     /* close our display and free resources */
203 > extern void
204 > dev_close(void)                 /* close our display and free resources */
205   {
206          glXMakeCurrent(ourdisplay, None, NULL);
207          glXDestroyContext(ourdisplay, gctx);
# Line 204 | Line 218 | dev_close()                    /* close our display and free resources
218   }
219  
220  
221 < dev_clear()                     /* clear our quadtree */
221 > extern void
222 > dev_clear(void)                 /* clear our quadtree */
223   {
224          qtCompost(100);
225          glClear(GL_DEPTH_BUFFER_BIT);
# Line 212 | Line 227 | dev_clear()                    /* clear our quadtree */
227   }
228  
229  
230 < int
231 < dev_view(nv)                    /* assign new driver view */
232 < register VIEW   *nv;
230 > extern int
231 > dev_view(                       /* assign new driver view */
232 >        register VIEW   *nv
233 > )
234   {
235          if (nv->type == VT_PAR ||               /* check view legality */
236                          nv->horiz > 160. || nv->vert > 160.) {
# Line 264 | Line 280 | register VIEW  *nv;
280   }
281  
282  
283 < dev_section(ofn)                /* add octree for geometry rendering */
284 < char    *ofn;
283 > extern void
284 > dev_section(            /* add octree for geometry rendering */
285 >        char    *ofn
286 > )
287   {
288          /* unimplemented */
289   }
290  
291  
292 < dev_auxcom(cmd, args)           /* process an auxiliary command */
293 < char    *cmd, *args;
292 > extern void
293 > dev_auxcom(             /* process an auxiliary command */
294 >        char    *cmd,
295 >        char    *args
296 > )
297   {
298          sprintf(errmsg, "%s: unknown command", cmd);
299          error(COMMAND, errmsg);
300   }
301  
302  
303 < VIEW *
304 < dev_auxview(n, hvres)           /* return nth auxiliary view */
305 < int     n;
306 < int     hvres[2];
303 > extern VIEW *
304 > dev_auxview(            /* return nth auxiliary view */
305 >        int     n,
306 >        int     hvres[2]
307 > )
308   {
309          if (n)
310                  return(NULL);
# Line 291 | Line 313 | int    hvres[2];
313   }
314  
315  
316 < int
317 < dev_input()                     /* get X11 input */
316 > extern int
317 > dev_input(void)                 /* get X11 input */
318   {
319          inpresflags = 0;
320  
# Line 305 | Line 327 | dev_input()                    /* get X11 input */
327   }
328  
329  
330 < int
331 < dev_flush()                     /* flush output */
330 > extern int
331 > dev_flush(void)                 /* flush output */
332   {
333          qtUpdate();
334          glFlush();
# Line 315 | Line 337 | dev_flush()                    /* flush output */
337   }
338  
339  
340 < dev_cone(rgb, ip, rad)          /* render a cone in view coordinates */
341 < BYTE    rgb[3];
342 < FVECT   ip;
343 < double  rad;
340 > extern void
341 > dev_cone(               /* render a cone in view coordinates */
342 >        BYTE    rgb[3],
343 >        FVECT   ip,
344 >        double  rad
345 > )
346   {
347          register int    ci, j;
348          double  apexh, basez;
# Line 355 | Line 379 | double rad;
379  
380  
381   static int
382 < mytmflags()                     /* figure out tone mapping flags */
382 > mytmflags(void)                 /* figure out tone mapping flags */
383   {
384          extern char     *progname;
385          register char   *cp, *tail;
# Line 370 | Line 394 | mytmflags()                    /* figure out tone mapping flags */
394          if (cp-tail == 5 && !strncmp(tail, "glx1h", 5))
395                  return(TM_F_HUMAN|TM_F_NOSTDERR);
396          error(USER, "illegal driver name");
397 +        return -1; /* pro forma return */
398   }
399  
400  
401 < static
402 < initcones()                     /* initialize cone vertices */
401 > static void
402 > initcones(void)                 /* initialize cone vertices */
403   {
404          register int    i, j;
405          double  minrad, d;
# Line 400 | Line 425 | initcones()                    /* initialize cone vertices */
425   }
426  
427  
428 < static
429 < freecones()                     /* free cone vertices */
428 > static void
429 > freecones(void)                 /* free cone vertices */
430   {
431          register int    i;
432  
# Line 414 | Line 439 | freecones()                    /* free cone vertices */
439   }
440  
441  
442 < static
443 < getevent()                      /* get next event */
442 > static void
443 > getevent(void)                  /* get next event */
444   {
445          XNextEvent(ourdisplay, levptr(XEvent));
446          switch (levptr(XEvent)->type) {
# Line 441 | Line 466 | getevent()                     /* get next event */
466   }
467  
468  
469 < static
470 < draw3dline(wp)                  /* draw 3d line in world coordinates */
471 < register FVECT  wp[2];
469 > static void
470 > draw3dline(                     /* draw 3d line in world coordinates */
471 >        register FVECT  wp[2]
472 > )
473   {
474          glVertex3d(wp[0][0], wp[0][1], wp[0][2]);
475          glVertex3d(wp[1][0], wp[1][1], wp[1][2]);
476   }
477  
478  
479 < static
480 < draw_grids()                    /* draw holodeck section grids */
479 > static void
480 > draw_grids(void)                        /* draw holodeck section grids */
481   {
482          static BYTE     gridrgba[4] = {0x0, 0xff, 0xff, 0x00};
483          double  xmin, xmax, ymin, ymax, zmin, zmax;
484 <        double  d, cx, sx, crad;
459 <        FVECT   vx, vy;
460 <        register int    i, j;
484 >        double  d;
485                                          /* can we even do it? */
486          if (!mapped || odev.v.type != VT_PER)
487                  return;
# Line 498 | Line 522 | draw_grids()                   /* draw holodeck section grids */
522   }
523  
524  
525 < static
526 < moveview(dx, dy, mov, orb)      /* move our view */
527 < int     dx, dy, mov, orb;
525 > static int
526 > moveview(       /* move our view */
527 >        int     dx,
528 >        int     dy,
529 >        int     mov,
530 >        int     orb
531 > )
532   {
533          VIEW    nv;
534          FVECT   odir, v1;
# Line 546 | Line 574 | int    dx, dy, mov, orb;
574   }
575  
576  
577 < static
578 < getmove(ebut)                           /* get view change */
579 < XButtonPressedEvent     *ebut;
577 > static void
578 > getmove(                                /* get view change */
579 >        XButtonPressedEvent     *ebut
580 > )
581   {
582          int     movdir = MOVDIR(ebut->button);
583          int     movorb = MOVORB(ebut->state);
# Line 588 | Line 617 | XButtonPressedEvent    *ebut;
617   }
618  
619  
620 < static
621 < getkey(ekey)                            /* get input key */
622 < register XKeyPressedEvent  *ekey;
620 > static void
621 > getkey(                         /* get input key */
622 >        register XKeyPressedEvent  *ekey
623 > )
624   {
625          int  n;
626          char    buf[8];
# Line 659 | Line 689 | register XKeyPressedEvent  *ekey;
689   }
690  
691  
692 < static
693 < fixwindow(eexp)                         /* repair damage to window */
694 < register XExposeEvent  *eexp;
692 > static void
693 > fixwindow(                              /* repair damage to window */
694 >        register XExposeEvent  *eexp
695 > )
696   {
697          int     xmin, xmax, ymin, ymax;
698  
# Line 684 | Line 715 | register XExposeEvent  *eexp;
715   }
716  
717  
718 < static
719 < resizewindow(ersz)                      /* resize window */
720 < register XConfigureEvent  *ersz;
718 > static void
719 > resizewindow(                   /* resize window */
720 >        register XConfigureEvent  *ersz
721 > )
722   {
723          glViewport(0, 0, ersz->width, ersz->height);
724  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines