#include #include #include #include #include #include #include int main() { Display* dpy = XOpenDisplay(NULL); XWindowAttributes attrib; XVisualInfo templ; XVisualInfo *visinfo; Colormap colormap; GLXFBConfig *fbConfigs; int value, nvisinfo; Window root = XRootWindow (dpy, 0); if (!XGetWindowAttributes (dpy, root, &attrib)) return 1; templ.visualid = XVisualIDFromVisual(attrib.visual); printf("Using visual 0x%x\n", templ.visualid); visinfo = XGetVisualInfo(dpy, VisualIDMask, &templ, &nvisinfo); if (!nvisinfo) { printf("Couldn't get visual info for default visual\n"); return 2; } glXGetConfig (dpy, visinfo, GLX_USE_GL, &value); if (!value) { printf("Root visual is not a GL visual\n"); XFree (visinfo); return 3; } glXGetConfig (dpy, visinfo, GLX_DOUBLEBUFFER, &value); if (!value) { printf("Root visual is not a double buffered GL visual\n"); XFree (visinfo); return 4; } return 0; }