summaryrefslogtreecommitdiffstats
path: root/libvo/cocoa_common.m
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2012-04-14 15:02:28 +0200
committerUoti Urpala <uau@mplayer2.org>2012-04-26 21:03:10 +0300
commitd3da92aea4e865b72194ecc76e0eab6e2a1179a3 (patch)
tree792420c1ef4bb57fa0b39eb6f3d61e32a7f47159 /libvo/cocoa_common.m
parent86790494d38c4f33f74875e1ab7a9dc1bdae1772 (diff)
downloadmpv-d3da92aea4e865b72194ecc76e0eab6e2a1179a3.tar.bz2
mpv-d3da92aea4e865b72194ecc76e0eab6e2a1179a3.tar.xz
cocoa_common, gl_common: add OSX specific getProcAddress
Run dlopen on the OpenGL dynamic library instead of on the binary. This should prevent crashes due to function conflicts when X11/lGL is linked. Remove mutual exclusion of the X11 and Cocoa backends.
Diffstat (limited to 'libvo/cocoa_common.m')
-rw-r--r--libvo/cocoa_common.m15
1 files changed, 15 insertions, 0 deletions
diff --git a/libvo/cocoa_common.m b/libvo/cocoa_common.m
index 63e8e90db4..5cc29cc78b 100644
--- a/libvo/cocoa_common.m
+++ b/libvo/cocoa_common.m
@@ -21,6 +21,8 @@
#import <OpenGL/OpenGL.h>
#import <QuartzCore/QuartzCore.h>
#import <CoreServices/CoreServices.h> // for CGDisplayHideCursor
+#include <dlfcn.h>
+
#include "cocoa_common.h"
#include "options.h"
@@ -117,6 +119,19 @@ bool vo_cocoa_gui_running(void)
return !!s;
}
+void *vo_cocoa_glgetaddr(const char *s)
+{
+ void *ret = NULL;
+ void *handle = dlopen(
+ "/System/Library/Frameworks/OpenGL.framework/OpenGL",
+ RTLD_LAZY | RTLD_LOCAL);
+ if (!handle)
+ return NULL;
+ ret = dlsym(handle, s);
+ dlclose(handle);
+ return ret;
+}
+
int vo_cocoa_init(struct vo *vo)
{
s = vo_cocoa_init_state();