22 |
|
|
23 |
|
#include "standard.h" |
24 |
|
|
25 |
– |
#include <sys/types.h> |
25 |
|
#include <GL/glx.h> |
26 |
|
#include <GL/glu.h> |
27 |
|
#ifdef STEREO |
38 |
|
#ifndef RAYQLEN |
39 |
|
#define RAYQLEN 0 /* max. rays to queue before flush */ |
40 |
|
#endif |
41 |
+ |
#ifndef MINWIDTH |
42 |
+ |
#define MINWIDTH 480 /* minimum graphics window width */ |
43 |
+ |
#define MINHEIGHT 400 /* minimum graphics window height */ |
44 |
+ |
#endif |
45 |
+ |
#ifndef VIEWDIST |
46 |
+ |
#define VIEWDIST 356 /* assumed viewing distance (mm) */ |
47 |
+ |
#endif |
48 |
+ |
#ifndef BORWIDTH |
49 |
+ |
#define BORWIDTH 5 /* border width */ |
50 |
+ |
#endif |
51 |
|
|
52 |
|
#ifndef FEQ |
53 |
|
#define FEQ(a,b) ((a)-(b) <= FTINY && (a)-(b) >= -FTINY) |
69 |
|
#define MOVDEG (-5) /* degrees to orbit CW/down /frame */ |
70 |
|
#define MOVORB(s) ((s)&ShiftMask ? 1 : (s)&ControlMask ? -1 : 0) |
71 |
|
|
63 |
– |
#define MINWIDTH 480 /* minimum graphics window width */ |
64 |
– |
#define MINHEIGHT 400 /* minimum graphics window height */ |
65 |
– |
|
66 |
– |
#define VIEWDIST 356 /* assumed viewing distance (mm) */ |
67 |
– |
|
68 |
– |
#define BORWIDTH 5 /* border width */ |
69 |
– |
|
72 |
|
#define setstereobuf(bid) (glXWaitGL(), \ |
73 |
|
XSGISetStereoBuffer(ourdisplay, gwind, bid), \ |
74 |
|
glXWaitX()) |
333 |
|
dev_input(); /* get resize event */ |
334 |
|
} |
335 |
|
copystruct(&odev.v, nv); /* setview() already called */ |
334 |
– |
#ifdef STEREO |
335 |
– |
copystruct(&vwright, nv); |
336 |
– |
d = eyesepdist / sqrt(nv->hn2); |
337 |
– |
VSUM(vwright.vp, nv->vp, nv->hvec, d); |
338 |
– |
/* setview(&vwright); -- Unnecessary */ |
339 |
– |
#endif |
336 |
|
viewflags |= VWCHANGE; |
337 |
|
} |
338 |
+ |
#ifdef STEREO |
339 |
+ |
copystruct(&vwright, nv); |
340 |
+ |
d = eyesepdist / sqrt(nv->hn2); |
341 |
+ |
VSUM(vwright.vp, nv->vp, nv->hvec, d); |
342 |
+ |
/* setview(&vwright); -- Unnecessary */ |
343 |
+ |
#endif |
344 |
|
wipeclean(); |
345 |
|
return(1); |
346 |
|
} |
867 |
|
dev_zmin = odev.v.vfore; |
868 |
|
if (odev.v.vaft > FTINY) |
869 |
|
dev_zmax = odev.v.vaft; |
870 |
< |
if (dev_zmin < dev_zmax/100.) |
871 |
< |
dev_zmin = dev_zmax/100.; |
870 |
> |
if (dev_zmin*500. < dev_zmax) |
871 |
> |
dev_zmax = dev_zmin*500.; |
872 |
|
setzrat(); |
873 |
|
xmax = dev_zmin * tan(PI/180./2. * odev.v.horiz); |
874 |
|
xmin = -xmax; |
944 |
|
viewflags &= ~VWCHANGE; /* change noted */ |
945 |
|
} else if (viewflags & VWSTEADY) |
946 |
|
odRedrawAll(); |
947 |
< |
setglpersp(&odev.v); /* reset view & clipping planes */ |
947 |
> |
setglpersp(); /* reset view & clipping planes */ |
948 |
|
} |
949 |
|
|
950 |
|
|