| 1 |
– |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
| 2 |
– |
|
| 1 |
|
#ifndef lint |
| 2 |
< |
static char SCCSid[] = "$SunId$ SGI"; |
| 2 |
> |
static const char RCSid[] = "$Id$"; |
| 3 |
|
#endif |
| 6 |
– |
|
| 4 |
|
/* |
| 5 |
|
* OpenGL driver for holodeck display. |
| 6 |
|
* Based on GLX driver using T-mesh. |
| 19 |
|
|
| 20 |
|
#include "standard.h" |
| 21 |
|
|
| 25 |
– |
#include <sys/types.h> |
| 22 |
|
#include <GL/glx.h> |
| 23 |
|
#include <GL/glu.h> |
| 24 |
|
#ifdef STEREO |
| 25 |
|
#include <X11/extensions/SGIStereo.h> |
| 26 |
|
#endif |
| 27 |
+ |
#include <time.h> |
| 28 |
|
|
| 29 |
|
#include "rhd_odraw.h" |
| 30 |
|
#ifdef DOBJ |
| 34 |
|
#include "x11icon.h" |
| 35 |
|
|
| 36 |
|
#ifndef RAYQLEN |
| 37 |
< |
#define RAYQLEN 50000 /* max. rays to queue before flush */ |
| 37 |
> |
#define RAYQLEN 0 /* max. rays to queue before flush */ |
| 38 |
|
#endif |
| 39 |
< |
|
| 40 |
< |
/* values other than 0 or 255 do not map reliably */ |
| 41 |
< |
#ifndef PORTALP |
| 45 |
< |
#define PORTRED 0 /* -1, 0 or 255 */ |
| 46 |
< |
#define PORTGRN -1 /* -1, 0 or 255 */ |
| 47 |
< |
#define PORTBLU 255 /* -1, 0 or 255 */ |
| 48 |
< |
#define PORTALP -1 /* -1 or 255 */ |
| 39 |
> |
#ifndef MINWIDTH |
| 40 |
> |
#define MINWIDTH 480 /* minimum graphics window width */ |
| 41 |
> |
#define MINHEIGHT 400 /* minimum graphics window height */ |
| 42 |
|
#endif |
| 43 |
< |
#define isportal(c) ((PORTRED<0 || (c)[0]==PORTRED) && \ |
| 44 |
< |
(PORTGRN<0 || (c)[1]==PORTGRN) && \ |
| 45 |
< |
(PORTBLU<0 || (c)[2]==PORTBLU) && \ |
| 46 |
< |
(PORTALP<0 || (c)[3]==PORTALP)) |
| 47 |
< |
#define doportals() if (gmPortals) \ |
| 48 |
< |
gmDrawPortals(PORTRED,PORTGRN,PORTBLU,PORTALP); else |
| 43 |
> |
#ifndef VIEWDIST |
| 44 |
> |
#define VIEWDIST 356 /* assumed viewing distance (mm) */ |
| 45 |
> |
#endif |
| 46 |
> |
#ifndef BORWIDTH |
| 47 |
> |
#define BORWIDTH 5 /* border width */ |
| 48 |
> |
#endif |
| 49 |
|
|
| 50 |
|
#ifndef FEQ |
| 51 |
|
#define FEQ(a,b) ((a)-(b) <= FTINY && (a)-(b) >= -FTINY) |
| 67 |
|
#define MOVDEG (-5) /* degrees to orbit CW/down /frame */ |
| 68 |
|
#define MOVORB(s) ((s)&ShiftMask ? 1 : (s)&ControlMask ? -1 : 0) |
| 69 |
|
|
| 77 |
– |
#define MINWIDTH 480 /* minimum graphics window width */ |
| 78 |
– |
#define MINHEIGHT 400 /* minimum graphics window height */ |
| 79 |
– |
|
| 80 |
– |
#define VIEWDIST 356 /* assumed viewing distance (mm) */ |
| 81 |
– |
|
| 82 |
– |
#define BORWIDTH 5 /* border width */ |
| 83 |
– |
|
| 70 |
|
#define setstereobuf(bid) (glXWaitGL(), \ |
| 71 |
|
XSGISetStereoBuffer(ourdisplay, gwind, bid), \ |
| 72 |
|
glXWaitX()) |
| 132 |
|
{ |
| 133 |
|
extern char *getenv(); |
| 134 |
|
static RGBPRIMS myprims = STDPRIMS; |
| 149 |
– |
#if (PORTALP<0) |
| 135 |
|
static int atlBest[] = {GLX_RGBA, GLX_DOUBLEBUFFER, |
| 136 |
|
GLX_RED_SIZE,8, GLX_GREEN_SIZE,8, |
| 137 |
|
GLX_BLUE_SIZE,8, GLX_DEPTH_SIZE,15, None}; |
| 138 |
|
static int atlOK[] = {GLX_RGBA, GLX_DOUBLEBUFFER, |
| 139 |
|
GLX_RED_SIZE,4, GLX_GREEN_SIZE,4, |
| 140 |
|
GLX_BLUE_SIZE,4, GLX_DEPTH_SIZE,15, None}; |
| 156 |
– |
#else |
| 157 |
– |
static int atlBest[] = {GLX_RGBA, GLX_DOUBLEBUFFER, |
| 158 |
– |
GLX_RED_SIZE,8, GLX_GREEN_SIZE,8, |
| 159 |
– |
GLX_BLUE_SIZE,8, GLX_ALPHA_SIZE,1, |
| 160 |
– |
GLX_DEPTH_SIZE,15, None}; |
| 161 |
– |
static int atlOK[] = {GLX_RGBA, GLX_DOUBLEBUFFER, |
| 162 |
– |
GLX_RED_SIZE,5, GLX_GREEN_SIZE,5, |
| 163 |
– |
GLX_BLUE_SIZE,5, GLX_ALPHA_SIZE,1, |
| 164 |
– |
GLX_DEPTH_SIZE,15, None}; |
| 165 |
– |
#endif |
| 141 |
|
char *ev; |
| 142 |
|
double gamval = GAMMA; |
| 143 |
|
RGBPRIMP dpri = stdprims; |
| 226 |
|
glXMakeCurrent(ourdisplay, gwind, gctx); |
| 227 |
|
glEnable(GL_DEPTH_TEST); |
| 228 |
|
glDepthFunc(GL_LEQUAL); |
| 229 |
< |
glEnable(GL_DITHER); |
| 229 |
> |
glClearColor(0, 0, 0, 0); |
| 230 |
|
glFrontFace(GL_CCW); |
| 231 |
|
glDisable(GL_CULL_FACE); |
| 232 |
|
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); |
| 233 |
|
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); |
| 234 |
+ |
glPixelStorei(GL_PACK_ALIGNMENT, 1); |
| 235 |
+ |
glPixelStorei(GL_UNPACK_ALIGNMENT, 1); |
| 236 |
|
/* figure out sensible view */ |
| 237 |
|
pwidth = (double)DisplayWidthMM(ourdisplay, ourscreen) / |
| 238 |
|
DisplayWidth(ourdisplay, ourscreen); |
| 250 |
|
XMapWindow(ourdisplay, gwind); |
| 251 |
|
dev_input(); /* sets size and view angles */ |
| 252 |
|
if (!odInit(DisplayWidth(ourdisplay,ourscreen) * |
| 253 |
< |
DisplayHeight(ourdisplay,ourscreen) / 4)) |
| 253 |
> |
DisplayHeight(ourdisplay,ourscreen) / 3)) |
| 254 |
|
error(SYSTEM, "insufficient memory for value storage"); |
| 255 |
|
odev.name = id; |
| 256 |
|
odev.firstuse = 1; /* can't recycle samples */ |
| 282 |
|
|
| 283 |
|
dev_clear() /* clear our representation */ |
| 284 |
|
{ |
| 285 |
< |
wipeclean(); |
| 285 |
> |
viewflags |= VWCHANGE; /* pretend our view has changed */ |
| 286 |
> |
wipeclean(); /* clean off display and samples */ |
| 287 |
> |
dev_flush(); /* redraw geometry & get depth */ |
| 288 |
|
rayqleft = 0; /* hold off update */ |
| 289 |
|
} |
| 290 |
|
|
| 331 |
|
dev_input(); /* get resize event */ |
| 332 |
|
} |
| 333 |
|
copystruct(&odev.v, nv); /* setview() already called */ |
| 355 |
– |
#ifdef STEREO |
| 356 |
– |
copystruct(&vwright, nv); |
| 357 |
– |
d = eyesepdist / sqrt(nv->hn2); |
| 358 |
– |
VSUM(vwright.vp, nv->vp, nv->hvec, d); |
| 359 |
– |
/* setview(&vwright); -- Unnecessary */ |
| 360 |
– |
#endif |
| 334 |
|
viewflags |= VWCHANGE; |
| 335 |
|
} |
| 336 |
+ |
#ifdef STEREO |
| 337 |
+ |
copystruct(&vwright, nv); |
| 338 |
+ |
d = eyesepdist / sqrt(nv->hn2); |
| 339 |
+ |
VSUM(vwright.vp, nv->vp, nv->hvec, d); |
| 340 |
+ |
/* setview(&vwright); -- Unnecessary */ |
| 341 |
+ |
#endif |
| 342 |
|
wipeclean(); |
| 343 |
|
return(1); |
| 344 |
|
} |
| 347 |
|
dev_section(gfn, pfn) /* add octree for geometry rendering */ |
| 348 |
|
char *gfn, *pfn; |
| 349 |
|
{ |
| 371 |
– |
extern char *index(); |
| 350 |
|
char *cp; |
| 351 |
|
|
| 352 |
|
if (gfn == NULL) { |
| 372 |
|
char *cmd, *args; |
| 373 |
|
{ |
| 374 |
|
#ifdef DOBJ |
| 375 |
< |
if (dobj_command(cmd, args) >= 0) |
| 375 |
> |
int vischange; |
| 376 |
> |
|
| 377 |
> |
if ((vischange = dobj_command(cmd, args)) >= 0) { |
| 378 |
> |
if (vischange) { |
| 379 |
> |
imm_mode = beam_sync(1) > 0; |
| 380 |
> |
dev_clear(); |
| 381 |
> |
} |
| 382 |
|
return; |
| 383 |
+ |
} |
| 384 |
|
#endif |
| 385 |
|
sprintf(errmsg, "%s: unknown command", cmd); |
| 386 |
|
error(COMMAND, errmsg); |
| 447 |
|
#ifdef DOBJ |
| 448 |
|
ndrawn += dobj_render(); |
| 449 |
|
#endif |
| 465 |
– |
if (ndrawn) |
| 466 |
– |
doportals(); |
| 450 |
|
checkglerr("rendering right eye"); |
| 451 |
|
popright(); /* draw left eye */ |
| 452 |
|
#endif |
| 454 |
|
#ifdef DOBJ |
| 455 |
|
ndrawn += dobj_render(); |
| 456 |
|
#endif |
| 474 |
– |
if (ndrawn) |
| 475 |
– |
doportals(); |
| 457 |
|
glXSwapBuffers(ourdisplay, gwind); |
| 458 |
|
checkglerr("rendering base view"); |
| 459 |
|
} |
| 499 |
|
xferdepth() /* load and clear depth buffer */ |
| 500 |
|
{ |
| 501 |
|
register GLfloat *dbp; |
| 502 |
< |
register GLubyte *cbuf; |
| 502 |
> |
register GLubyte *pbuf; |
| 503 |
|
|
| 504 |
|
if (depthbuffer == NULL) { /* allocate private depth buffer */ |
| 505 |
|
#ifdef STEREO |
| 512 |
|
} |
| 513 |
|
/* allocate alpha buffer for portals */ |
| 514 |
|
if (gmPortals) |
| 515 |
< |
cbuf = (GLubyte *)malloc(odev.hres*odev.vres * |
| 535 |
< |
(4*sizeof(GLubyte))); |
| 515 |
> |
pbuf = (GLubyte *)malloc(odev.hres*odev.vres*sizeof(GLubyte)); |
| 516 |
|
else |
| 517 |
< |
cbuf = NULL; |
| 517 |
> |
pbuf = NULL; |
| 518 |
|
#ifdef STEREO |
| 519 |
< |
setstereobuf(STEREO_BUFFER_RIGHT); |
| 519 |
> |
pushright(); |
| 520 |
|
glReadPixels(0, 0, odev.hres, odev.vres, |
| 521 |
|
GL_DEPTH_COMPONENT, GL_FLOAT, depthright); |
| 522 |
< |
if (cbuf != NULL) |
| 522 |
> |
if (pbuf != NULL) { |
| 523 |
> |
glClear(GL_COLOR_BUFFER_BIT); |
| 524 |
> |
gmDrawPortals(0xff, -1, -1, -1); |
| 525 |
|
glReadPixels(0, 0, odev.hres, odev.vres, |
| 526 |
< |
GL_RGBA, GL_UNSIGNED_BYTE, cbuf); |
| 526 |
> |
GL_RED, GL_UNSIGNED_BYTE, pbuf); |
| 527 |
> |
} |
| 528 |
|
for (dbp = depthright + odev.hres*odev.vres; dbp-- > depthright; ) |
| 529 |
< |
if (cbuf != NULL && isportal(cbuf+4*(dbp-depthright))) |
| 529 |
> |
if (pbuf != NULL && pbuf[dbp-depthright]&0x40) |
| 530 |
|
*dbp = FHUGE; |
| 531 |
|
else |
| 532 |
|
*dbp = mapdepth(*dbp); |
| 533 |
|
glClear(GL_DEPTH_BUFFER_BIT); |
| 551 |
– |
setstereobuf(STEREO_BUFFER_LEFT); |
| 534 |
|
odDepthMap(1, depthright); |
| 535 |
+ |
popright(); |
| 536 |
|
#endif |
| 537 |
|
/* read back depth buffer */ |
| 538 |
|
glReadPixels(0, 0, odev.hres, odev.vres, |
| 539 |
|
GL_DEPTH_COMPONENT, GL_FLOAT, depthbuffer); |
| 540 |
< |
if (cbuf != NULL) |
| 540 |
> |
if (pbuf != NULL) { |
| 541 |
> |
glClear(GL_COLOR_BUFFER_BIT); /* find portals */ |
| 542 |
> |
gmDrawPortals(0xff, -1, -1, -1); |
| 543 |
|
glReadPixels(0, 0, odev.hres, odev.vres, |
| 544 |
< |
GL_RGBA, GL_UNSIGNED_BYTE, cbuf); |
| 544 |
> |
GL_RED, GL_UNSIGNED_BYTE, pbuf); |
| 545 |
> |
#ifdef DEBUG |
| 546 |
> |
glXSwapBuffers(ourdisplay, gwind); |
| 547 |
> |
#endif |
| 548 |
> |
} |
| 549 |
|
for (dbp = depthbuffer + odev.hres*odev.vres; dbp-- > depthbuffer; ) |
| 550 |
< |
if (cbuf != NULL && isportal(cbuf+4*(dbp-depthbuffer))) |
| 550 |
> |
if (pbuf != NULL && pbuf[dbp-depthbuffer]&0x40) |
| 551 |
|
*dbp = FHUGE; |
| 552 |
|
else |
| 553 |
|
*dbp = mapdepth(*dbp); |
| 554 |
|
glClear(GL_DEPTH_BUFFER_BIT); /* clear system depth buffer */ |
| 566 |
– |
if (cbuf != NULL) |
| 567 |
– |
free((char *)cbuf); /* free our color buffer */ |
| 555 |
|
odDepthMap(0, depthbuffer); /* transfer depth data */ |
| 556 |
+ |
if (pbuf != NULL) |
| 557 |
+ |
free((void *)pbuf); /* free our portal buffer */ |
| 558 |
|
} |
| 559 |
|
|
| 560 |
|
|
| 565 |
|
return; |
| 566 |
|
#ifdef STEREO |
| 567 |
|
odDepthMap(1, NULL); |
| 568 |
< |
free((char *)depthright); |
| 568 |
> |
free((void *)depthright); |
| 569 |
|
depthright = NULL; |
| 570 |
|
#endif |
| 571 |
|
odDepthMap(0, NULL); |
| 572 |
< |
free((char *)depthbuffer); |
| 572 |
> |
free((void *)depthbuffer); |
| 573 |
|
depthbuffer = NULL; |
| 574 |
|
} |
| 575 |
|
|
| 580 |
|
FVECT direc; |
| 581 |
|
{ |
| 582 |
|
GLfloat gldepth; |
| 594 |
– |
GLubyte glcolor[4]; |
| 583 |
|
double dist; |
| 584 |
|
|
| 585 |
|
if (dx<0 | dx>=odev.hres | dy<0 | dy>=odev.vres) |
| 589 |
|
else { |
| 590 |
|
glReadPixels(dx,dy, 1,1, GL_DEPTH_COMPONENT, |
| 591 |
|
GL_FLOAT, &gldepth); |
| 604 |
– |
if (gmPortals) { |
| 605 |
– |
glReadPixels(dx,dy, 1,1, GL_RGBA, |
| 606 |
– |
GL_UNSIGNED_BYTE, glcolor); |
| 607 |
– |
if (isportal(glcolor)) |
| 608 |
– |
return(FHUGE); |
| 609 |
– |
} |
| 592 |
|
dist = mapdepth(gldepth); |
| 593 |
|
} |
| 594 |
|
if (dist >= .99*FHUGE) |
| 789 |
|
|
| 790 |
|
|
| 791 |
|
static |
| 792 |
+ |
waitabit() /* pause a moment */ |
| 793 |
+ |
{ |
| 794 |
+ |
struct timespec ts; |
| 795 |
+ |
ts.tv_sec = 0; |
| 796 |
+ |
ts.tv_nsec = 50000000; |
| 797 |
+ |
nanosleep(&ts, NULL); |
| 798 |
+ |
} |
| 799 |
+ |
|
| 800 |
+ |
|
| 801 |
+ |
static |
| 802 |
|
getmove(ebut) /* get view change */ |
| 803 |
|
XButtonPressedEvent *ebut; |
| 804 |
|
{ |
| 812 |
|
XNoOp(ourdisplay); /* makes sure we're not idle */ |
| 813 |
|
|
| 814 |
|
viewflags &= ~VWSTEADY; /* flag moving view */ |
| 815 |
< |
setglpersp(&odev.v); /* start us off in perspective */ |
| 815 |
> |
setglpersp(); /* start us off in perspective */ |
| 816 |
|
while (!XCheckMaskEvent(ourdisplay, |
| 817 |
|
ButtonReleaseMask, levptr(XEvent))) { |
| 818 |
+ |
/* pause so as not to move too fast */ |
| 819 |
+ |
waitabit(); |
| 820 |
|
/* get cursor position */ |
| 821 |
|
if (!XQueryPointer(ourdisplay, gwind, &rootw, &childw, |
| 822 |
|
&rootx, &rooty, &wx, &wy, &statemask)) |
| 834 |
|
#ifdef DOBJ |
| 835 |
|
ndrawn += dobj_render(); |
| 836 |
|
#endif |
| 843 |
– |
if (ndrawn) |
| 844 |
– |
doportals(); |
| 837 |
|
popright(); |
| 838 |
|
#endif |
| 839 |
|
/* redraw octrees */ |
| 841 |
|
#ifdef DOBJ |
| 842 |
|
ndrawn += dobj_render(); /* redraw objects */ |
| 843 |
|
#endif |
| 852 |
– |
if (ndrawn) |
| 853 |
– |
doportals(); |
| 844 |
|
glXSwapBuffers(ourdisplay, gwind); |
| 845 |
|
if (!ndrawn) |
| 846 |
|
sleep(1); /* for reasonable interaction */ |
| 856 |
|
|
| 857 |
|
|
| 858 |
|
static |
| 859 |
< |
setglpersp(vp) /* set perspective view in GL */ |
| 870 |
< |
register VIEW *vp; |
| 859 |
> |
setglpersp() /* set perspective view in GL */ |
| 860 |
|
{ |
| 861 |
|
double d, xmin, xmax, ymin, ymax; |
| 862 |
|
GLfloat vec[4]; |
| 868 |
|
dev_zmax = 100.; |
| 869 |
|
} else { |
| 870 |
|
dev_zmin = 0.5*depthlim[0]; |
| 871 |
< |
dev_zmax = 1.75*depthlim[1]; |
| 871 |
> |
dev_zmax = 1.25*depthlim[1]; |
| 872 |
|
if (dev_zmin > dev_zmax/5.) |
| 873 |
|
dev_zmin = dev_zmax/5.; |
| 874 |
|
} |
| 876 |
|
dev_zmin = odev.v.vfore; |
| 877 |
|
if (odev.v.vaft > FTINY) |
| 878 |
|
dev_zmax = odev.v.vaft; |
| 879 |
< |
if (dev_zmin < dev_zmax/100.) |
| 880 |
< |
dev_zmin = dev_zmax/100.; |
| 879 |
> |
if (dev_zmin*500. < dev_zmax) |
| 880 |
> |
dev_zmin = dev_zmax/500.; |
| 881 |
|
setzrat(); |
| 882 |
|
xmax = dev_zmin * tan(PI/180./2. * odev.v.horiz); |
| 883 |
|
xmin = -xmax; |
| 938 |
|
wipeclean() /* prepare for redraw */ |
| 939 |
|
{ |
| 940 |
|
glDrawBuffer(GL_BACK); /* use double-buffer mode */ |
| 941 |
< |
glReadBuffer(GL_FRONT); /* read back visible contents */ |
| 953 |
< |
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); |
| 941 |
> |
glReadBuffer(GL_BACK); |
| 942 |
|
/* clear buffers */ |
| 943 |
|
#ifdef STEREO |
| 944 |
|
setstereobuf(STEREO_BUFFER_RIGHT); |
| 946 |
|
setstereobuf(STEREO_BUFFER_LEFT); |
| 947 |
|
#endif |
| 948 |
|
glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT); |
| 961 |
– |
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE); |
| 949 |
|
freedepth(); |
| 950 |
|
if ((viewflags&(VWCHANGE|VWSTEADY)) == |
| 951 |
|
(VWCHANGE|VWSTEADY)) { /* clear samples if new */ |
| 952 |
|
odClean(); |
| 953 |
|
viewflags &= ~VWCHANGE; /* change noted */ |
| 954 |
< |
} |
| 955 |
< |
setglpersp(&odev.v); /* reset view & clipping planes */ |
| 954 |
> |
} else if (viewflags & VWSTEADY) |
| 955 |
> |
odRedrawAll(); |
| 956 |
> |
setglpersp(); /* reset view & clipping planes */ |
| 957 |
|
} |
| 958 |
|
|
| 959 |
|
|
| 1003 |
|
inpresflags |= DFL(DC_RESUME); |
| 1004 |
|
return; |
| 1005 |
|
case CTRL('R'): /* redraw screen */ |
| 1006 |
< |
odRemap(0); |
| 1006 |
> |
odRemap(0); /* new tone mapping */ |
| 1007 |
|
glClear(GL_DEPTH_BUFFER_BIT); |
| 1008 |
|
#ifdef STEREO |
| 1009 |
|
setstereobuf(STEREO_BUFFER_RIGHT); |
| 1013 |
|
return; |
| 1014 |
|
case CTRL('L'): /* refresh from server */ |
| 1015 |
|
if (inpresflags & DFL(DC_REDRAW)) |
| 1016 |
< |
return; |
| 1016 |
> |
return; /* already called */ |
| 1017 |
|
XRaiseWindow(ourdisplay, gwind); |
| 1018 |
< |
XFlush(ourdisplay); |
| 1019 |
< |
sleep(1); |
| 1020 |
< |
wipeclean(); /* fresh display */ |
| 1021 |
< |
odRemap(1); /* fresh tone mapping */ |
| 1034 |
< |
dev_flush(); /* draw octrees */ |
| 1018 |
> |
XFlush(ourdisplay); /* raise up window */ |
| 1019 |
> |
sleep(1); /* wait for restacking */ |
| 1020 |
> |
dev_clear(); /* clear buffer and samples */ |
| 1021 |
> |
odRemap(1); /* start fresh histogram */ |
| 1022 |
|
inpresflags |= DFL(DC_REDRAW); /* resend values from server */ |
| 1036 |
– |
rayqleft = 0; /* hold off update */ |
| 1023 |
|
return; |
| 1024 |
|
case 'K': /* kill rtrace process(es) */ |
| 1025 |
|
inpresflags |= DFL(DC_KILL); |
| 1052 |
|
} |
| 1053 |
|
xmin = eexp->x; xmax = eexp->x + eexp->width; |
| 1054 |
|
ymin = odev.vres - eexp->y - eexp->height; ymax = odev.vres - eexp->y; |
| 1055 |
+ |
|
| 1056 |
+ |
if (xmin <= 0 && xmax >= odev.hres-1 && |
| 1057 |
+ |
ymin <= 0 && ymax >= odev.vres) { |
| 1058 |
+ |
DCHECK(eexp->count, WARNING, "multiple clear in fixwindow"); |
| 1059 |
+ |
wipeclean(); /* make sure we're go */ |
| 1060 |
+ |
return; |
| 1061 |
+ |
} |
| 1062 |
|
/* clear portion of depth */ |
| 1063 |
|
glPushAttrib(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT); |
| 1064 |
|
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); |