+ // return visual ID
+ XVisualInfo *vi = glXGetVisualFromFBConfig(display, config);
+ VisualID visualid = vi->visualid;
+ XFree(vi);
+ return visualid;
+}
+
+bool GLXBackend::haveGLXExtension(const std::string &name)
+{
+ assert(display != NULL);
+ std::string extensions = glXQueryExtensionsString(display, DefaultScreen(display));
+ return (std::string(" "+extensions+" ").find(" "+name+" ") != std::string::npos);
+}
+
+T_proc GLXBackend::resolveGLXFunction(const char *extension, const char *function)
+{
+ if (!haveGLXExtension(extension)) return NULL;
+ T_proc f = glXGetProcAddress((const GLubyte*)function);
+ if (f)
+ printf("%s is supported, using it for %s\n", extension, function);
+ return f;