[MPlayer-cvslog] CVS: main/libvo gl_common.c,1.34,1.35
Reimar Döffinger CVS
syncmail at mplayerhq.hu
Sat Nov 19 15:00:37 CET 2005
CVS change done by Reimar Döffinger CVS
Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv13892
Modified Files:
gl_common.c
Log Message:
Also parse glX extension string, makes -vo gl:swapinterval work again on linux
Index: gl_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/gl_common.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- gl_common.c 13 Nov 2005 21:53:26 -0000 1.34
+++ gl_common.c 19 Nov 2005 14:00:35 -0000 1.35
@@ -249,9 +249,13 @@
/**
* \brief find the function pointers of some useful OpenGL extensions
* \param getProcAddress function to resolve function names, may be NULL
+ * \param ext2 an extra extension string
*/
-static void getFunctions(void *(*getProcAddress)(const GLubyte *)) {
+static void getFunctions(void *(*getProcAddress)(const GLubyte *),
+ const char *ext2) {
const char *extensions = glGetString(GL_EXTENSIONS);
+ if (!extensions) extensions = "";
+ if (!ext2) ext2 = "";
if (!getProcAddress)
getProcAddress = setNull;
GenBuffers = getProcAddress("glGenBuffers");
@@ -324,7 +328,7 @@
ProgramEnvParameter4f = getProcAddress("glProgramEnvParameter4fARB");
if (!ProgramEnvParameter4f)
ProgramEnvParameter4f = getProcAddress("glProgramEnvParameter4fNV");
- if (!extensions || !strstr(extensions, "_swap_control"))
+ if (!strstr(extensions, "_swap_control") && !strstr(ext2, "_swap_control"))
SwapInterval = NULL;
else {
SwapInterval = getProcAddress("glXSwapInterval");
@@ -1003,7 +1007,7 @@
wglDeleteContext(*context);
*context = new_context;
*vinfo = new_vinfo;
- getFunctions(w32gpa);
+ getFunctions(w32gpa, NULL);
// and inform that reinit is neccessary
return SET_WINDOW_REINIT;
@@ -1117,6 +1121,7 @@
}
if (!keep_context) {
void *(*getProcAddress)(const GLubyte *);
+ const char *(*glXExtStr)(Display *, int);
if (*context)
glXDestroyContext(mDisplay, *context);
*context = new_context;
@@ -1128,7 +1133,9 @@
getProcAddress = getdladdr("glXGetProcAddressARB");
if (!getProcAddress)
getProcAddress = getdladdr;
- getFunctions(getProcAddress);
+ glXExtStr = getdladdr("glXQueryExtensionsString");
+ getFunctions(getProcAddress, !glXExtStr ? NULL :
+ glXExtStr(mDisplay, DefaultScreen(mDisplay)));
// and inform that reinit is neccessary
return SET_WINDOW_REINIT;
More information about the MPlayer-cvslog
mailing list