ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/hd/rhd_ogl.c
(Generate patch)

Comparing ray/src/hd/rhd_ogl.c (file contents):
Revision 3.3 by gwlarson, Mon Dec 21 11:42:38 1998 UTC vs.
Revision 3.5 by gwlarson, Mon Dec 21 15:31:49 1998 UTC

# Line 162 | Line 162 | char  *id;
162   #endif
163                                          /* open display server */
164          ourdisplay = XOpenDisplay(NULL);
165 <        if (ourdisplay == NULL)
166 <                error(USER, "cannot open X-windows; DISPLAY variable set?\n");
165 >        CHECK(ourdisplay==NULL, USER,
166 >                        "cannot open X-windows; DISPLAY variable set?");
167   #ifdef STEREO
168          switch (XSGIQueryStereoMode(ourdisplay, ourroot)) {
169          case STEREO_TOP:
# Line 171 | Line 171 | char  *id;
171                  break;
172          case STEREO_OFF:
173                  error(USER,
174 <        "wrong video mode: run \"/usr/gfx/setmon -n STR_TOP\" first");
174 >                "wrong video mode: run \"/usr/gfx/setmon -n STR_TOP\" first");
175          case X_STEREO_UNSUPPORTED:
176                  error(USER, "stereo mode not supported on this screen");
177          default:
# Line 180 | Line 180 | char  *id;
180   #endif
181                                          /* find a usable visual */
182          ourvinf = glXChooseVisual(ourdisplay, ourscreen, atlBest);
183 <        if (ourvinf == NULL)
184 <                error(USER, "no suitable visuals available");
183 >        CHECK(ourvinf==NULL, USER, "no suitable visuals available");
184                                          /* get a context */
185          gctx = glXCreateContext(ourdisplay, ourvinf, NULL, GL_TRUE);
186                                          /* set gamma and tone mapping */
# Line 213 | Line 212 | char  *id;
212   #endif
213                  BORWIDTH, ourvinf->depth, InputOutput, ourvinf->visual,
214                  CWBackPixel|CWBorderPixel|CWColormap|CWEventMask, &ourwinattr);
215 <        if (gwind == 0)
217 <                error(SYSTEM, "cannot create window\n");
215 >        CHECK(gwind==0, SYSTEM, "cannot create window");
216          XStoreName(ourdisplay, gwind, id);
217                                          /* set window manager hints */
218          ourxwmhints.flags = InputHint|IconPixmapHint;
# Line 262 | Line 260 | char  *id;
260          XMapWindow(ourdisplay, gwind);
261          dev_input();                    /* sets size and view angles */
262          if (!odInit(DisplayWidth(ourdisplay,ourscreen) *
263 <                        DisplayHeight(ourdisplay,ourscreen) / 10))
263 >                        DisplayHeight(ourdisplay,ourscreen) / 4))
264                  error(SYSTEM, "insufficient memory for value storage");
265          odev.name = id;
266          odev.firstuse = 1;              /* can't recycle samples */
# Line 363 | Line 361 | char   *gfn, *pfn;
361          if (gfn == NULL) {
362                  gmEndGeom();
363                  gmEndPortal();
364 +                wipeclean();            /* new geometry, so redraw it */
365                  return;
366          }
367          if (access(gfn, R_OK) == 0)
# Line 463 | Line 462 | dev_flush()                    /* flush output as appropriate */
462                          gmDrawPortals(PORTRED, PORTGRN, PORTBLU, PORTALP);
463                  checkglerr("rendering base view");
464          }
465 <        if (mapped && viewsteady) {
466 <                if (isperspective) {            /* first time after steady */
468 < #ifdef STEREO
469 <                        pushright();
470 <                        popright();
471 < #endif
465 >        if (mapped && viewsteady)
466 >                if (isperspective > 0) {        /* first time after steady */
467                          if (ndrawn)
468                                  xferdepth();    /* transfer and clear depth */
469                          setglortho();           /* set orthographic view */
470 <                } else {
470 >                } else if (!isperspective) {
471   #ifdef STEREO
472                          pushright();
473                          odUpdate(1);            /* draw right eye */
# Line 480 | Line 475 | dev_flush()                    /* flush output as appropriate */
475   #endif
476                          odUpdate(0);            /* draw left eye */
477                  }
483        }
478          glFlush();                              /* flush OpenGL */
479          rayqleft = RAYQLEN;
480                                          /* flush X11 and return # pending */
# Line 514 | Line 508 | xferdepth()                    /* load and clear depth buffer */
508   #endif
509                  depthbuffer = (GLfloat *)malloc(
510                                  odev.hres*odev.vres*sizeof(GLfloat));
511 <                if (depthbuffer == NULL)
518 <                        error(SYSTEM, "out of memory in xferdepth");
511 >                CHECK(depthbuffer==NULL, SYSTEM, "out of memory in xferdepth");
512          }
513                                  /* allocate alpha buffer for portals */
514          if (gmPortals)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines