[MPlayer-cvslog] CVS: main/libvo gl_common.c,1.25,1.26

Reimar Döffinger CVS syncmail at mplayerhq.hu
Sun Sep 25 18:12:03 CEST 2005


CVS change done by Reimar Döffinger CVS

Update of /cvsroot/mplayer/main/libvo
In directory mail:/var2/tmp/cvs-serv139

Modified Files:
	gl_common.c 
Log Message:
get rid of global getProcAddress variable


Index: gl_common.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/gl_common.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- gl_common.c	25 Sep 2005 16:07:54 -0000	1.25
+++ gl_common.c	25 Sep 2005 16:12:01 -0000	1.26
@@ -213,12 +213,11 @@
   return NULL;
 }
 
-static void *(*getProcAddress)(const GLubyte *procName) = NULL;
-
 /**
  * \brief find the function pointers of some useful OpenGL extensions
+ * \param getProcAddress function to resolve function names, may be NULL
  */
-static void getFunctions() {
+static void getFunctions(void *(*getProcAddress)(const GLubyte *)) {
   if (!getProcAddress)
     getProcAddress = setNull;
   GenBuffers = getProcAddress("glGenBuffers");
@@ -794,8 +793,7 @@
       wglDeleteContext(*context);
     *context = new_context;
     *vinfo = new_vinfo;
-    getProcAddress = w32gpa;
-    getFunctions();
+    getFunctions(w32gpa);
 
     // and inform that reinit is neccessary
     return SET_WINDOW_REINIT;
@@ -906,19 +904,19 @@
                   &vo_dwidth, &vo_dheight, &tmp, &tmp);
   }
   if (!keep_context) {
+    void *(*getProcAddress)(const GLubyte *);
     if (*context)
       glXDestroyContext(mDisplay, *context);
     *context = new_context;
     if (*vinfo)
       XFree(*vinfo);
     *vinfo = new_vinfo;
-    if (!getProcAddress)
       getProcAddress = getdladdr("glXGetProcAddress");
     if (!getProcAddress)
       getProcAddress = getdladdr("glXGetProcAddressARB");
     if (!getProcAddress)
       getProcAddress = getdladdr;
-    getFunctions();
+    getFunctions(getProcAddress);
 
     // and inform that reinit is neccessary
     return SET_WINDOW_REINIT;




More information about the MPlayer-cvslog mailing list