161 |
|
/* map the window */ |
162 |
|
XMapWindow(ourdisplay, gwind); |
163 |
|
dev_input(); /* sets size and view angles */ |
164 |
– |
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
164 |
|
/* allocate our leaf pile */ |
165 |
|
if (!qtAllocLeaves(2 * DisplayWidth(ourdisplay,ourscreen) * |
166 |
|
DisplayHeight(ourdisplay,ourscreen) / |
283 |
|
else |
284 |
|
apexh = 1. - ip[2]/(curzmax*DEPTHFACT); |
285 |
|
} |
286 |
< |
/* find closest cone match */ |
286 |
> |
rad *= 1.25; /* find conservative cone match */ |
287 |
|
for (ci = 0; ci < MAXCONE-1; ci++) |
288 |
|
if (cone[ci].rad >= rad) |
289 |
|
break; |
566 |
|
inpresflags |= DFL(DC_RESUME); |
567 |
|
return; |
568 |
|
case CTRL('R'): /* redraw screen */ |
569 |
+ |
if (nxtzmax > FTINY) { |
570 |
+ |
curzmax = nxtzmax; |
571 |
+ |
nxtzmax = 0.; |
572 |
+ |
} |
573 |
|
glClear(GL_DEPTH_BUFFER_BIT); |
574 |
|
qtRedraw(0, 0, odev.hres, odev.vres); |
575 |
|
return; |
576 |
|
case CTRL('L'): /* refresh from server */ |
577 |
|
if (inpresflags & DFL(DC_REDRAW)) |
578 |
|
return; |
579 |
+ |
if (nxtzmax > FTINY) { |
580 |
+ |
curzmax = nxtzmax; |
581 |
+ |
nxtzmax = 0.; |
582 |
+ |
} |
583 |
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); |
584 |
|
draw_grids(); |
585 |
|
glFlush(); |
634 |
|
resizewindow(ersz) /* resize window */ |
635 |
|
register XConfigureEvent *ersz; |
636 |
|
{ |
637 |
+ |
glViewport(0, 0, ersz->width, ersz->height); |
638 |
+ |
|
639 |
|
if (ersz->width == odev.hres && ersz->height == odev.vres) |
640 |
|
return; |
641 |
|
|
644 |
|
|
645 |
|
odev.v.horiz = 2.*180./PI * atan(0.5/VIEWDIST*pwidth*odev.hres); |
646 |
|
odev.v.vert = 2.*180./PI * atan(0.5/VIEWDIST*pheight*odev.vres); |
638 |
– |
|
639 |
– |
glViewport(0, 0, odev.hres, odev.vres); |
647 |
|
|
648 |
|
inpresflags |= DFL(DC_SETVIEW); |
649 |
|
} |