diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-12-28 19:10:44 +0100 |
---|---|---|
committer | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2014-12-28 19:10:44 +0100 |
commit | f987625d5a84546b564bd15635c4051af5dc7113 (patch) | |
tree | 7de71cc8b0521baafc0d0cdc1789fe9eaf4f642f /video/out | |
parent | 9270dda50a4059cfc063714cd4f6dfdaf305f532 (diff) | |
download | mpv-f987625d5a84546b564bd15635c4051af5dc7113.tar.bz2 mpv-f987625d5a84546b564bd15635c4051af5dc7113.tar.xz |
cocoa: move the gl function loader to gl_cocoa.c
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/cocoa_common.h | 2 | ||||
-rw-r--r-- | video/out/cocoa_common.m | 14 | ||||
-rw-r--r-- | video/out/gl_cocoa.c | 16 |
3 files changed, 15 insertions, 17 deletions
diff --git a/video/out/cocoa_common.h b/video/out/cocoa_common.h index be68b7ca22..30792a674e 100644 --- a/video/out/cocoa_common.h +++ b/video/out/cocoa_common.h @@ -24,8 +24,6 @@ struct vo_cocoa_state; -void *vo_cocoa_glgetaddr(const char *s); - int vo_cocoa_init(struct vo *vo); void vo_cocoa_uninit(struct vo *vo); diff --git a/video/out/cocoa_common.m b/video/out/cocoa_common.m index 6f4603b65f..01e28aceda 100644 --- a/video/out/cocoa_common.m +++ b/video/out/cocoa_common.m @@ -20,7 +20,6 @@ #import <Cocoa/Cocoa.h> #import <CoreServices/CoreServices.h> // for CGDisplayHideCursor #import <IOKit/pwr_mgt/IOPMLib.h> -#include <dlfcn.h> #import "cocoa_common.h" #import "video/out/cocoa/window.h" @@ -112,19 +111,6 @@ static void queue_new_video_size(struct vo *vo, int w, int h) } } -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; -} - static void enable_power_management(struct vo *vo) { struct vo_cocoa_state *s = vo->cocoa; diff --git a/video/out/gl_cocoa.c b/video/out/gl_cocoa.c index 32c66675f0..4cbeda2441 100644 --- a/video/out/gl_cocoa.c +++ b/video/out/gl_cocoa.c @@ -20,6 +20,7 @@ */ #include <OpenGL/OpenGL.h> +#include <dlfcn.h> #include "cocoa_common.h" #include "osdep/macosx_versions.h" #include "gl_common.h" @@ -44,6 +45,19 @@ static int cgl_color_size(struct MPGLContext *ctx) return value > 16 ? 8 : 5; } +static void *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; +} + static bool create_gl_context(struct MPGLContext *ctx) { struct cgl_context *p = ctx->priv; @@ -102,7 +116,7 @@ static bool create_gl_context(struct MPGLContext *ctx) vo_cocoa_create_nsgl_ctx(ctx->vo, p->ctx); ctx->depth_r = ctx->depth_g = ctx->depth_b = cgl_color_size(ctx); - mpgl_load_functions(ctx->gl, (void *)vo_cocoa_glgetaddr, NULL, ctx->vo->log); + mpgl_load_functions(ctx->gl, (void *)cocoa_glgetaddr, NULL, ctx->vo->log); CGLReleasePixelFormat(p->pix); |