changeset 29679:465247b46e39

Also check GLX client and server strings for extensions
author reimar
date Sun, 27 Sep 2009 14:24:15 +0000
parents b6f4746cedab
children 57ed11e0d3ce
files libvo/gl_common.c
diffstat 1 files changed, 27 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/gl_common.c	Sat Sep 26 21:22:01 2009 +0000
+++ b/libvo/gl_common.c	Sun Sep 27 14:24:15 2009 +0000
@@ -1563,6 +1563,21 @@
   return XGetVisualInfo(mDisplay, VisualIDMask, &vinfo_template, &tmp);
 }
 
+static void appendstr(char **dst, const char *str)
+{
+    int newsize;
+    char *newstr;
+    if (!str)
+        return;
+    newsize = strlen(*dst) + 1 + strlen(str) + 1;
+    newstr = realloc(*dst, newsize);
+    if (!newstr)
+        return;
+    *dst = newstr;
+    strcat(*dst, " ");
+    strcat(*dst, str);
+}
+
 /**
  * \brief Changes the window in which video is displayed.
  * If possible only transfers the context to the new window, otherwise
@@ -1619,6 +1634,7 @@
   if (!keep_context) {
     void *(*getProcAddress)(const GLubyte *);
     const char *(*glXExtStr)(Display *, int);
+    char *glxstr = strdup("");
     if (*context)
       glXDestroyContext(mDisplay, *context);
     *context = new_context;
@@ -1631,8 +1647,17 @@
     if (!getProcAddress)
       getProcAddress = (void *)getdladdr;
     glXExtStr = getdladdr("glXQueryExtensionsString");
-    getFunctions(getProcAddress, !glXExtStr ? NULL :
-                 glXExtStr(mDisplay, DefaultScreen(mDisplay)));
+    if (glXExtStr)
+        appendstr(&glxstr, glXExtStr(mDisplay, DefaultScreen(mDisplay)));
+    glXExtStr = getdladdr("glXGetClientString");
+    if (glXExtStr)
+        appendstr(&glxstr, glXExtStr(mDisplay, GLX_EXTENSIONS));
+    glXExtStr = getdladdr("glXGetServerString");
+    if (glXExtStr)
+        appendstr(&glxstr, glXExtStr(mDisplay, GLX_EXTENSIONS));
+
+    getFunctions(getProcAddress, glxstr);
+    free(glxstr);
 
     // and inform that reinit is neccessary
     return SET_WINDOW_REINIT;