}
-static void
+static GLboolean
get_visual_attribs(Display *dpy, XVisualInfo *vInfo,
struct visual_attribs *attribs)
{
attribs->bitsPerRGB = vInfo->bits_per_rgb;
if (glXGetConfig(dpy, vInfo, GLX_USE_GL, &attribs->supportsGL) != 0)
- return;
+ return GL_FALSE;
glXGetConfig(dpy, vInfo, GLX_BUFFER_SIZE, &attribs->bufferSize);
glXGetConfig(dpy, vInfo, GLX_LEVEL, &attribs->level);
glXGetConfig(dpy, vInfo, GLX_RGBA, &attribs->rgba);
#else
attribs->visualCaveat = 0;
#endif
+
+ return GL_TRUE;
}
if (mode == Verbose) {
for (i = 0; i < numVisuals; i++) {
struct visual_attribs attribs;
- get_visual_attribs(dpy, &visuals[i], &attribs);
+ if (!get_visual_attribs(dpy, &visuals[i], &attribs))
+ continue;
print_visual_attribs_verbose(&attribs);
}
}
print_visual_attribs_short_header();
for (i = 0; i < numVisuals; i++) {
struct visual_attribs attribs;
- get_visual_attribs(dpy, &visuals[i], &attribs);
+ if (!get_visual_attribs(dpy, &visuals[i], &attribs))
+ continue;
print_visual_attribs_short(&attribs);
}
}
print_visual_attribs_long_header();
for (i = 0; i < numVisuals; i++) {
struct visual_attribs attribs;
- get_visual_attribs(dpy, &visuals[i], &attribs);
+ if (!get_visual_attribs(dpy, &visuals[i], &attribs))
+ continue;
print_visual_attribs_long(&attribs);
}
}