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: |
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: |
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 */ |
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; |
508 |
|
#endif |
509 |
|
depthbuffer = (GLfloat *)malloc( |
510 |
|
odev.hres*odev.vres*sizeof(GLfloat)); |
511 |
< |
if (depthbuffer == NULL) |
514 |
< |
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) |