#include #include int main(void) { Display *display; int error, event, major, minor, n; GLXFBConfig *fbconfig; GLXContext context; display = XOpenDisplay(NULL); if (display == NULL) { return 1; } if (!glXQueryExtension(display, &error, &event) || !glXQueryVersion(display, &major, &minor)) { XCloseDisplay(display); return 1; } fbconfig = glXGetFBConfigs(display, DefaultScreen(display), &n); context = glXCreateNewContext(display, fbconfig[0], GLX_RGBA_TYPE, NULL, True); glXMakeContextCurrent(display, DefaultRootWindow(display), DefaultRootWindow(display), context); XCloseDisplay(display); return 0; }