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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines