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

Comparing ray/src/hd/rhd_glx.c (file contents):
Revision 3.14 by gregl, Tue Jan 6 05:26:19 1998 UTC vs.
Revision 3.15 by gregl, Tue Jan 6 13:07:57 1998 UTC

# Line 94 | Line 94 | dev_open(id)                   /* initialize X11 driver */
94   char  *id;
95   {
96          extern char     *getenv();
97 +        static RGBPRIMS myprims = STDPRIMS;
98          static int      atlBest[] = {GLX_RGBA, GLX_RED_SIZE,8,
99                                  GLX_GREEN_SIZE,8, GLX_BLUE_SIZE,8,
100                                  GLX_DEPTH_SIZE,15, None};
101 <        char    *gv;
101 >        char    *ev;
102          double  gamval = GAMMA;
103 +        RGBPRIMP        dpri = stdprims;
104          XSetWindowAttributes    ourwinattr;
105          XWMHints        ourxwmhints;
106          XSizeHints      oursizhints;
# Line 116 | Line 118 | char  *id;
118                                          /* get a context */
119          gctx = glXCreateContext(ourdisplay, ourvinf, NULL, GL_TRUE);
120                                          /* set gamma and tone mapping */
121 <        if ((gv = XGetDefault(ourdisplay, "radiance", "gamma")) != NULL
122 <                        || (gv = getenv("DISPLAY_GAMMA")) != NULL)
123 <                gamval = atof(gv);
124 <        if (tmInit(mytmflags(), stdprims, gamval) == NULL)
121 >        if ((ev = XGetDefault(ourdisplay, "radiance", "gamma")) != NULL
122 >                        || (ev = getenv("DISPLAY_GAMMA")) != NULL)
123 >                gamval = atof(ev);
124 >        if ((ev = getenv("DISPLAY_PRIMARIES")) != NULL &&
125 >                        sscanf(ev, "%f %f %f %f %f %f %f %f",
126 >                                &myprims[RED][CIEX],&myprims[RED][CIEY],
127 >                                &myprims[GRN][CIEX],&myprims[GRN][CIEY],
128 >                                &myprims[BLU][CIEX],&myprims[BLU][CIEY],
129 >                                &myprims[WHT][CIEX],&myprims[WHT][CIEY]) >= 6)
130 >                dpri = myprims;
131 >        if (tmInit(mytmflags(), dpri, gamval) == NULL)
132                  error(SYSTEM, "not enough memory in dev_open");
133                                          /* open window */
134          ourwinattr.background_pixel = ourblack;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines