[MPlayer-cvslog] CVS: main/libvo gl_common.c,1.8,1.9
Reimar Döffinger CVS
syncmail at mplayerhq.hu
Tue Jul 26 20:28:53 CEST 2005
- Previous message: [MPlayer-cvslog] CVS: main/libvo gl_common.c, 1.7, 1.8 gl_common.h, 1.6, 1.7 vo_gl.c, 1.75, 1.76 w32_common.c, 1.10, 1.11 w32_common.h, 1.3, 1.4
- Next message: [MPlayer-cvslog] CVS: main/libvo gl_common.c,1.8,1.9
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
CVS change done by Reimar Döffinger CVS
Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv14835
Modified Files:
gl_common.c
Log Message:
Use dlsym to get glXGetProcAddress, only way to (hopefully) make it
compile everywhere since the gl/glx headers are such a mess...
Index: gl_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/gl_common.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- gl_common.c 26 Jul 2005 13:47:18 -0000 1.8
+++ gl_common.c 26 Jul 2005 18:28:51 -0000 1.9
@@ -201,7 +201,7 @@
return NULL;
}
-static void *(*getProcAddress)(const GLubyte *procName);
+static void *(*getProcAddress)(const GLubyte *procName) = NULL;
static void getFunctions() {
if (!getProcAddress)
@@ -326,6 +326,26 @@
*context = 0;
}
#else
+#if defined(__sun) || defined(__sgi)
+extern void *dlopen(const char *, int);
+#endif
+extern void *dlsym(void *, const char *);
+/**
+ * \brief find address of a linked function
+ * \param s name of function to find
+ * \return address of function or NULL if not found
+ *
+ * Copied from xine
+ */
+static void *getdladdr(const GLubyte *s) {
+#if defined(__sun) || defined(__sgi)
+ static void *handle = dlopen(NULL, RTLD_LAZY);
+ return dlsym(handle, s);
+#else
+ return dlsym(0, s);
+#endif
+}
+
/**
* \brief Returns the XVisualInfo associated with Window win.
* \param win Window whose XVisualInfo is returne.
@@ -403,11 +423,12 @@
if (*vinfo)
XFree(*vinfo);
*vinfo = new_vinfo;
-#ifdef GLX_ARB_get_proc_address
- getProcAddress = (void *)glXGetProcAddressARB;
-#else
- getProcAddress = NULL;
-#endif
+ if (!getProcAddress)
+ getProcAddress = getdladdr("glXGetProcAddress");
+ if (!getProcAddress)
+ getProcAddress = getdladdr("glXGetProcAddressARB");
+ if (!getProcAddress)
+ getProcAddress = getdladdr;
getFunctions();
// and inform that reinit is neccessary
- Previous message: [MPlayer-cvslog] CVS: main/libvo gl_common.c, 1.7, 1.8 gl_common.h, 1.6, 1.7 vo_gl.c, 1.75, 1.76 w32_common.c, 1.10, 1.11 w32_common.h, 1.3, 1.4
- Next message: [MPlayer-cvslog] CVS: main/libvo gl_common.c,1.8,1.9
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the MPlayer-cvslog
mailing list