From fe3b9a88ce62ab0e562b326d15f398a801ba1a92 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 27 Sep 2009 14:24:15 +0000 Subject: Also check GLX client and server strings for extensions git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29721 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/gl_common.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'libvo') diff --git a/libvo/gl_common.c b/libvo/gl_common.c index b9ded01436..1bf8c906c3 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -1563,6 +1563,21 @@ static XVisualInfo *getWindowVisualInfo(Window win) { 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 @@ int setGlWindow(XVisualInfo **vinfo, GLXContext *context, Window win) 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 @@ int setGlWindow(XVisualInfo **vinfo, GLXContext *context, Window win) 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; -- cgit v1.2.3