| 33 |
|
#define MOVDEG (-5) /* degrees to orbit CW/down /frame */ |
| 34 |
|
#define MOVORB(s) ((s)&ShiftMask ? 1 : (s)&ControlMask ? -1 : 0) |
| 35 |
|
|
| 36 |
– |
#define MINWIDTH 480 /* minimum graphics window width */ |
| 37 |
– |
#define MINHEIGHT 400 /* minimum graphics window height */ |
| 38 |
– |
|
| 36 |
|
#define BORWIDTH 5 /* border width */ |
| 37 |
|
|
| 38 |
|
#define ourscreen DefaultScreen(ourdisplay) |
| 90 |
|
|
| 91 |
|
int displist; /* our scene display list */ |
| 92 |
|
|
| 93 |
< |
int in_dev_view = 0; /* currently in dev_view() */ |
| 93 |
> |
int no_render = 0; /* don't rerender */ |
| 94 |
|
|
| 95 |
|
#ifdef BSD |
| 96 |
|
#define strchr index |
| 371 |
|
GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE,15, None}; |
| 372 |
|
XSetWindowAttributes ourwinattr; |
| 373 |
|
XWMHints ourxwmhints; |
| 377 |
– |
XSizeHints oursizhints; |
| 374 |
|
/* open display server */ |
| 375 |
|
ourdisplay = XOpenDisplay(NULL); |
| 376 |
|
if (ourdisplay == NULL) |
| 417 |
|
ourxwmhints.icon_pixmap = XCreateBitmapFromData(ourdisplay, |
| 418 |
|
gwind, glradicon_bits, glradicon_width, glradicon_height); |
| 419 |
|
XSetWMHints(ourdisplay, gwind, &ourxwmhints); |
| 424 |
– |
oursizhints.min_width = MINWIDTH; |
| 425 |
– |
oursizhints.min_height = stereo ? MINHEIGHT/2 : MINHEIGHT; |
| 426 |
– |
oursizhints.flags = PMinSize; |
| 427 |
– |
XSetNormalHints(ourdisplay, gwind, &oursizhints); |
| 420 |
|
/* set GLX context */ |
| 421 |
|
glXMakeCurrent(ourdisplay, gwind, gctx); |
| 422 |
|
glEnable(GL_DEPTH_TEST); |
| 444 |
|
} |
| 445 |
|
/* map the window */ |
| 446 |
|
XMapWindow(ourdisplay, gwind); |
| 447 |
+ |
no_render++; |
| 448 |
|
do |
| 449 |
|
dev_input(0); /* get resize event */ |
| 450 |
|
while (hres == 0 & vres == 0); |
| 451 |
+ |
no_render--; |
| 452 |
|
rgl_checkerr("initializing GLX"); |
| 453 |
|
} |
| 454 |
|
|
| 499 |
|
} |
| 500 |
|
} |
| 501 |
|
if (newhres != hres | newvres != vres) { |
| 502 |
< |
in_dev_view++; |
| 502 |
> |
no_render++; |
| 503 |
|
XResizeWindow(ourdisplay, gwind, newhres, newvres); |
| 504 |
|
do |
| 505 |
|
dev_input(0); /* get resize event */ |
| 506 |
|
while (newhres != hres | newvres != vres); |
| 507 |
< |
in_dev_view--; |
| 507 |
> |
no_render--; |
| 508 |
|
} |
| 509 |
|
} |
| 510 |
|
copystruct(&thisview, nv); |
| 558 |
|
{ |
| 559 |
|
double d; |
| 560 |
|
|
| 561 |
< |
if (!mapped) |
| 561 |
> |
if (!mapped | no_render) |
| 562 |
|
return; |
| 563 |
|
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); |
| 564 |
|
glCallList(displist); |
| 884 |
|
glViewport(0, 0, hres=ersz->width, vres=ersz->height); |
| 885 |
|
if (hres > maxhres) maxhres = hres; |
| 886 |
|
if (vres > maxvres) maxvres = vres; |
| 887 |
< |
if (in_dev_view) |
| 887 |
> |
if (no_render) |
| 888 |
|
return; |
| 889 |
|
wa = (vres*pheight)/(hres*pwidth); |
| 890 |
|
va = viewaspect(&thisview); |