16 |
|
|
17 |
|
#include "x11icon.h" |
18 |
|
|
19 |
+ |
#ifndef RAYQLEN |
20 |
+ |
#define RAYQLEN 50000 /* max. rays to queue before flush */ |
21 |
+ |
#endif |
22 |
+ |
|
23 |
|
#ifndef FEQ |
24 |
|
#define FEQ(a,b) ((a)-(b) <= FTINY && (a)-(b) >= -FTINY) |
25 |
|
#endif |
104 |
|
XSizeHints oursizhints; |
105 |
|
/* set quadtree globals */ |
106 |
|
qtMinNodesiz = 3; |
107 |
+ |
qtDepthEps = 0.07; |
108 |
|
/* open display server */ |
109 |
|
ourdisplay = XOpenDisplay(NULL); |
110 |
|
if (ourdisplay == NULL) |
166 |
|
/* map the window */ |
167 |
|
XMapWindow(ourdisplay, gwind); |
168 |
|
dev_input(); /* sets size and view angles */ |
164 |
– |
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
169 |
|
/* allocate our leaf pile */ |
170 |
< |
if (!qtAllocLeaves(2 * DisplayWidth(ourdisplay,ourscreen) * |
170 |
> |
if (!qtAllocLeaves(DisplayWidth(ourdisplay,ourscreen) * |
171 |
|
DisplayHeight(ourdisplay,ourscreen) / |
172 |
|
(qtMinNodesiz*qtMinNodesiz))) |
173 |
|
error(SYSTEM, "insufficient memory for value storage"); |
266 |
|
{ |
267 |
|
qtUpdate(); |
268 |
|
glFlush(); |
269 |
+ |
rayqleft = RAYQLEN; |
270 |
|
return(XPending(ourdisplay)); |
271 |
|
} |
272 |
|
|
319 |
|
for (cp = tail; *cp && *cp != '.'; cp++) |
320 |
|
; |
321 |
|
if (cp-tail == 3 && !strncmp(tail, "glx", 3)) |
322 |
< |
return(TM_F_CAMERA); |
322 |
> |
return(TM_F_CAMERA|TM_F_NOSTDERR); |
323 |
|
if (cp-tail == 4 && !strncmp(tail, "glxh", 4)) |
324 |
< |
return(TM_F_HUMAN); |
324 |
> |
return(TM_F_HUMAN|TM_F_NOSTDERR); |
325 |
|
error(USER, "illegal driver name"); |
326 |
|
} |
327 |
|
|
572 |
|
inpresflags |= DFL(DC_RESUME); |
573 |
|
return; |
574 |
|
case CTRL('R'): /* redraw screen */ |
575 |
+ |
if (nxtzmax > FTINY) { |
576 |
+ |
curzmax = nxtzmax; |
577 |
+ |
nxtzmax = 0.; |
578 |
+ |
} |
579 |
|
glClear(GL_DEPTH_BUFFER_BIT); |
580 |
|
qtRedraw(0, 0, odev.hres, odev.vres); |
581 |
|
return; |
582 |
|
case CTRL('L'): /* refresh from server */ |
583 |
|
if (inpresflags & DFL(DC_REDRAW)) |
584 |
|
return; |
585 |
+ |
if (nxtzmax > FTINY) { |
586 |
+ |
curzmax = nxtzmax; |
587 |
+ |
nxtzmax = 0.; |
588 |
+ |
} |
589 |
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
590 |
|
draw_grids(); |
591 |
|
glFlush(); |
640 |
|
resizewindow(ersz) /* resize window */ |
641 |
|
register XConfigureEvent *ersz; |
642 |
|
{ |
643 |
+ |
glViewport(0, 0, ersz->width, ersz->height); |
644 |
+ |
|
645 |
|
if (ersz->width == odev.hres && ersz->height == odev.vres) |
646 |
|
return; |
647 |
|
|
650 |
|
|
651 |
|
odev.v.horiz = 2.*180./PI * atan(0.5/VIEWDIST*pwidth*odev.hres); |
652 |
|
odev.v.vert = 2.*180./PI * atan(0.5/VIEWDIST*pheight*odev.vres); |
638 |
– |
|
639 |
– |
glViewport(0, 0, odev.hres, odev.vres); |
653 |
|
|
654 |
|
inpresflags |= DFL(DC_SETVIEW); |
655 |
|
} |