--- ray/src/util/glrad.c 1998/06/18 17:18:27 3.5 +++ ray/src/util/glrad.c 1999/01/29 15:28:36 3.12 @@ -8,15 +8,15 @@ static char SCCSid[] = "$SunId$ SGI"; * Program to display Radiance scene using OpenGL. */ -#include "radogl.h" -#include "view.h" -#include "paths.h" #include #include #ifndef NOSTEREO #include #endif #include +#include "radogl.h" +#include "view.h" +#include "paths.h" #include "glradicon.h" #ifndef MAXVIEW @@ -161,10 +161,10 @@ char *argv[]; dev_open(radfile = argv[i]); /* load octree or scene files */ if (octree != NULL) { - displist = rgl_octlist(octree, NULL, NULL); + displist = rgl_octlist(octree, NULL, NULL, NULL); startrtrace(octree); } else - displist = rgl_filelist(nscenef, scene); + displist = rgl_filelist(nscenef, scene, NULL); /* set initial view */ dev_view(currentview < 0 ? &thisview : vwl[currentview].v); /* input/render loop */ @@ -173,7 +173,8 @@ char *argv[]; /* all done */ quit(0); userr: - fprintf(stderr, "Usage: %s [-w][-b][-v view] rfile [VAR=value]..\n", + fprintf(stderr, + "Usage: %s [-w][-s][-b][-S][-v view] rfile [VAR=value]..\n", argv[0]); quit(1); } @@ -297,7 +298,7 @@ char **av; atof(sskip2(buf+4,1)), atof(sskip2(buf+4,2))); else if (backvis && !strncmp(buf, "-bv", 3) && - (!buf[3] || strchr(" 0-FfNn", buf[3]) != NULL)) + (!buf[3] || strchr("0-FfNn \n",buf[3])!=NULL)) backvis = 0; fclose(fp); unlink(optfile); /* delete options file */ @@ -423,15 +424,14 @@ char *id; glDepthFunc(GL_LESS); glShadeModel(GL_SMOOTH); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); + glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); glEnable(GL_LIGHTING); + glFrontFace(GL_CCW); + glCullFace(GL_BACK); if (backvis) glDisable(GL_CULL_FACE); - else { - glFrontFace(GL_CCW); - glCullFace(GL_BACK); + else glEnable(GL_CULL_FACE); - } glDrawBuffer(GL_BACK); /* figure out sensible view */ pwidth = (double)DisplayWidthMM(ourdisplay, ourscreen) / @@ -809,8 +809,6 @@ int vwnum; ; else if (vwnum >= MAXVIEW || vwl[vwnum].v == NULL) vwnum = 0; - if (vwnum == currentview) - return; copylastv("standard view"); dev_view(vwl[currentview=vwnum].v); }