[MPlayer-cvslog] r35188 - in trunk/libvo: gl_common.c osx_common.h osx_objc_common.h osx_objc_common.m
reimar
subversion at mplayerhq.hu
Thu Sep 13 23:46:59 CEST 2012
Author: reimar
Date: Thu Sep 13 23:46:59 2012
New Revision: 35188
Log:
Provide a swap buffer function for OS X.
It does not change any of the issues with double buffering.
Modified:
trunk/libvo/gl_common.c
trunk/libvo/osx_common.h
trunk/libvo/osx_objc_common.h
trunk/libvo/osx_objc_common.m
Modified: trunk/libvo/gl_common.c
==============================================================================
--- trunk/libvo/gl_common.c Thu Sep 13 23:45:14 2012 (r35187)
+++ trunk/libvo/gl_common.c Thu Sep 13 23:46:59 2012 (r35188)
@@ -2359,7 +2359,7 @@ int init_mpglcontext(MPGLContext *ctx, e
#endif
#ifdef CONFIG_GL_OSX
case GLTYPE_OSX:
-// ctx->swapGlBuffers = swapGlBuffers_osx;
+ ctx->swapGlBuffers = vo_osx_swap_buffers;
ctx->update_xinerama_info = vo_osx_update_xinerama_info;
ctx->check_events = vo_osx_check_events;
ctx->fullscreen = vo_osx_fullscreen;
Modified: trunk/libvo/osx_common.h
==============================================================================
--- trunk/libvo/osx_common.h Thu Sep 13 23:45:14 2012 (r35187)
+++ trunk/libvo/osx_common.h Thu Sep 13 23:46:59 2012 (r35188)
@@ -32,5 +32,6 @@ void vo_osx_ontop(void);
void vo_osx_fullscreen(void);
int vo_osx_check_events(void);
void vo_osx_update_xinerama_info(void);
+void vo_osx_swap_buffers(void);
#endif /* MPLAYER_OSX_COMMON_H */
Modified: trunk/libvo/osx_objc_common.h
==============================================================================
--- trunk/libvo/osx_objc_common.h Thu Sep 13 23:45:14 2012 (r35187)
+++ trunk/libvo/osx_objc_common.h Thu Sep 13 23:46:59 2012 (r35188)
@@ -53,6 +53,7 @@
int event_flags;
@public
float winSizeMult;
+ NSOpenGLContext *glContext;
}
- (BOOL) acceptsFirstResponder;
Modified: trunk/libvo/osx_objc_common.m
==============================================================================
--- trunk/libvo/osx_objc_common.m Thu Sep 13 23:45:14 2012 (r35187)
+++ trunk/libvo/osx_objc_common.m Thu Sep 13 23:46:59 2012 (r35188)
@@ -98,6 +98,11 @@ void vo_osx_update_xinerama_info(void)
[oglv update_screen_info];
}
+void vo_osx_swap_buffers(void)
+{
+ [oglv->glContext flushBuffer];
+}
+
@implementation MPCommonOpenGLView
- (void) update_screen_info
{
@@ -126,7 +131,6 @@ void vo_osx_update_xinerama_info(void)
- (void) preinit
{
- NSOpenGLContext *glContext;
GLint swapInterval = 1;
NSApplicationLoad();
@@ -169,11 +173,11 @@ void vo_osx_update_xinerama_info(void)
[glContext setValues:&swapInterval forParameter:NSOpenGLCPSwapInterval];
[glContext setView:self];
[glContext makeCurrentContext];
- [glContext release];
}
- (void) dealloc
{
+ [glContext release];
[self setOpenGLContext:nil];
[super dealloc];
}
More information about the MPlayer-cvslog
mailing list