diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-09-25 16:12:01 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-09-25 16:12:01 +0000 |
commit | d06ea270be05df33769eb73ccf347ba551a7c2e5 (patch) | |
tree | fdefb1d431ebcef52cf2f4c89d4aa65df8a68594 /libvo | |
parent | f84b4218e508757ead601ba624d9ad11903519d9 (diff) | |
download | mpv-d06ea270be05df33769eb73ccf347ba551a7c2e5.tar.bz2 mpv-d06ea270be05df33769eb73ccf347ba551a7c2e5.tar.xz |
get rid of global getProcAddress variable
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16589 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/gl_common.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/libvo/gl_common.c b/libvo/gl_common.c index 2ca28c3fa3..936c4618a3 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -213,12 +213,11 @@ static void *setNull(const GLubyte *s) { 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 @@ int setGlWindow(int *vinfo, HGLRC *context, HWND win) 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 @@ int setGlWindow(XVisualInfo **vinfo, GLXContext *context, Window win) &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; |