diff options
author | Stefano Pigozzi <stefano.pigozzi@gmail.com> | 2011-12-09 21:25:05 +0100 |
---|---|---|
committer | wm4 <wm4@mplayer2.org> | 2012-03-31 02:58:52 +0200 |
commit | b00c1335c83be933b96de9464779a0e74c34331d (patch) | |
tree | a384ac705d47511303d395ee0b0ba6f551ccebef /libvo/gl_common.c | |
parent | 35c29bdd52c04098f928fd7151a7f2e94337bea0 (diff) | |
download | mpv-b00c1335c83be933b96de9464779a0e74c34331d.tar.bz2 mpv-b00c1335c83be933b96de9464779a0e74c34331d.tar.xz |
gl_common: cocoa: add OpenGL 3.2 context creation code
Add a new option to the cocoa window creation code in order to decide
which OpenGL context to create.
Diffstat (limited to 'libvo/gl_common.c')
-rw-r--r-- | libvo/gl_common.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libvo/gl_common.c b/libvo/gl_common.c index 223404fd85..230e5dc2bd 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -1769,12 +1769,22 @@ void glDrawTex(GL *gl, GLfloat x, GLfloat y, GLfloat w, GLfloat h, static int create_window_cocoa(struct MPGLContext *ctx, uint32_t d_width, uint32_t d_height, uint32_t flags) { - if (vo_cocoa_create_window(ctx->vo, d_width, d_height, flags) == 0) { + if (vo_cocoa_create_window(ctx->vo, d_width, d_height, flags, 0) == 0) { return SET_WINDOW_OK; } else { return SET_WINDOW_FAILED; } } + +static int create_window_cocoa_gl3(struct MPGLContext *ctx, int gl_flags, + int gl_version, uint32_t d_width, + uint32_t d_height, uint32_t flags) +{ + int rv = vo_cocoa_create_window(ctx->vo, d_width, d_height, flags, 1); + getFunctions(ctx->gl, (void *)getdladdr, NULL, true); + return rv; +} + static int setGlWindow_cocoa(MPGLContext *ctx) { vo_cocoa_change_attributes(ctx->vo); @@ -2465,6 +2475,7 @@ MPGLContext *init_mpglcontext(enum MPGLType type, struct vo *vo) #ifdef CONFIG_GL_COCOA case GLTYPE_COCOA: ctx->create_window = create_window_cocoa; + ctx->create_window_gl3 = create_window_cocoa_gl3; ctx->setGlWindow = setGlWindow_cocoa; ctx->releaseGlContext = releaseGlContext_cocoa; ctx->swapGlBuffers = swapGlBuffers_cocoa; |