100 |
|
XSizeHints oursizhints; |
101 |
|
/* set quadtree globals */ |
102 |
|
qtMinNodesiz = 3; |
103 |
+ |
qtDepthEps = 0.07; |
104 |
|
/* open display server */ |
105 |
|
ourdisplay = XOpenDisplay(NULL); |
106 |
|
if (ourdisplay == NULL) |
162 |
|
/* map the window */ |
163 |
|
XMapWindow(ourdisplay, gwind); |
164 |
|
dev_input(); /* sets size and view angles */ |
164 |
– |
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
165 |
|
/* allocate our leaf pile */ |
166 |
< |
if (!qtAllocLeaves(2 * DisplayWidth(ourdisplay,ourscreen) * |
166 |
> |
if (!qtAllocLeaves(DisplayWidth(ourdisplay,ourscreen) * |
167 |
|
DisplayHeight(ourdisplay,ourscreen) / |
168 |
|
(qtMinNodesiz*qtMinNodesiz))) |
169 |
|
error(SYSTEM, "insufficient memory for value storage"); |
567 |
|
inpresflags |= DFL(DC_RESUME); |
568 |
|
return; |
569 |
|
case CTRL('R'): /* redraw screen */ |
570 |
+ |
if (nxtzmax > FTINY) { |
571 |
+ |
curzmax = nxtzmax; |
572 |
+ |
nxtzmax = 0.; |
573 |
+ |
} |
574 |
|
glClear(GL_DEPTH_BUFFER_BIT); |
575 |
|
qtRedraw(0, 0, odev.hres, odev.vres); |
576 |
|
return; |
577 |
|
case CTRL('L'): /* refresh from server */ |
578 |
|
if (inpresflags & DFL(DC_REDRAW)) |
579 |
|
return; |
580 |
+ |
if (nxtzmax > FTINY) { |
581 |
+ |
curzmax = nxtzmax; |
582 |
+ |
nxtzmax = 0.; |
583 |
+ |
} |
584 |
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
585 |
|
draw_grids(); |
586 |
|
glFlush(); |
635 |
|
resizewindow(ersz) /* resize window */ |
636 |
|
register XConfigureEvent *ersz; |
637 |
|
{ |
638 |
+ |
glViewport(0, 0, ersz->width, ersz->height); |
639 |
+ |
|
640 |
|
if (ersz->width == odev.hres && ersz->height == odev.vres) |
641 |
|
return; |
642 |
|
|
645 |
|
|
646 |
|
odev.v.horiz = 2.*180./PI * atan(0.5/VIEWDIST*pwidth*odev.hres); |
647 |
|
odev.v.vert = 2.*180./PI * atan(0.5/VIEWDIST*pheight*odev.vres); |
638 |
– |
|
639 |
– |
glViewport(0, 0, odev.hres, odev.vres); |
648 |
|
|
649 |
|
inpresflags |= DFL(DC_SETVIEW); |
650 |
|
} |