Also check GLX client and server strings for extensions

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29721 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2009-09-27 14:24:15 +00:00
parent a5abf5851c
commit fe3b9a88ce
1 changed files with 27 additions and 2 deletions

View File

@ -1563,6 +1563,21 @@ static XVisualInfo *getWindowVisualInfo(Window win) {
return XGetVisualInfo(mDisplay, VisualIDMask, &vinfo_template, &tmp); 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. * \brief Changes the window in which video is displayed.
* If possible only transfers the context to the new window, otherwise * If possible only transfers the context to the new window, otherwise
@ -1619,6 +1634,7 @@ int setGlWindow(XVisualInfo **vinfo, GLXContext *context, Window win)
if (!keep_context) { if (!keep_context) {
void *(*getProcAddress)(const GLubyte *); void *(*getProcAddress)(const GLubyte *);
const char *(*glXExtStr)(Display *, int); const char *(*glXExtStr)(Display *, int);
char *glxstr = strdup("");
if (*context) if (*context)
glXDestroyContext(mDisplay, *context); glXDestroyContext(mDisplay, *context);
*context = new_context; *context = new_context;
@ -1631,8 +1647,17 @@ int setGlWindow(XVisualInfo **vinfo, GLXContext *context, Window win)
if (!getProcAddress) if (!getProcAddress)
getProcAddress = (void *)getdladdr; getProcAddress = (void *)getdladdr;
glXExtStr = getdladdr("glXQueryExtensionsString"); glXExtStr = getdladdr("glXQueryExtensionsString");
getFunctions(getProcAddress, !glXExtStr ? NULL : if (glXExtStr)
glXExtStr(mDisplay, DefaultScreen(mDisplay))); 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 // and inform that reinit is neccessary
return SET_WINDOW_REINIT; return SET_WINDOW_REINIT;