Mercurial > mplayer.hg
comparison libvo/osx_objc_common.m @ 35094:967b0f13715c
Provide a swap buffer function for OS X.
It does not change any of the issues with double buffering.
author | reimar |
---|---|
date | Thu, 13 Sep 2012 21:46:59 +0000 |
parents | cc8276116e95 |
children | 84bb4ca7c6dd |
comparison
equal
deleted
inserted
replaced
35093:627492239a72 | 35094:967b0f13715c |
---|---|
96 void vo_osx_update_xinerama_info(void) | 96 void vo_osx_update_xinerama_info(void) |
97 { | 97 { |
98 [oglv update_screen_info]; | 98 [oglv update_screen_info]; |
99 } | 99 } |
100 | 100 |
101 void vo_osx_swap_buffers(void) | |
102 { | |
103 [oglv->glContext flushBuffer]; | |
104 } | |
105 | |
101 @implementation MPCommonOpenGLView | 106 @implementation MPCommonOpenGLView |
102 - (void) update_screen_info | 107 - (void) update_screen_info |
103 { | 108 { |
104 int screen_id = xinerama_screen; | 109 int screen_id = xinerama_screen; |
105 NSArray *screen_array = [NSScreen screens]; | 110 NSArray *screen_array = [NSScreen screens]; |
124 aspect_save_screenres(vo_screenwidth, vo_screenheight); | 129 aspect_save_screenres(vo_screenwidth, vo_screenheight); |
125 } | 130 } |
126 | 131 |
127 - (void) preinit | 132 - (void) preinit |
128 { | 133 { |
129 NSOpenGLContext *glContext; | |
130 GLint swapInterval = 1; | 134 GLint swapInterval = 1; |
131 | 135 |
132 NSApplicationLoad(); | 136 NSApplicationLoad(); |
133 NSApp = [NSApplication sharedApplication]; | 137 NSApp = [NSApplication sharedApplication]; |
134 isLeopardOrLater = floor(NSAppKitVersionNumber) > 824; | 138 isLeopardOrLater = floor(NSAppKitVersionNumber) > 824; |
167 | 171 |
168 [self setOpenGLContext:glContext]; | 172 [self setOpenGLContext:glContext]; |
169 [glContext setValues:&swapInterval forParameter:NSOpenGLCPSwapInterval]; | 173 [glContext setValues:&swapInterval forParameter:NSOpenGLCPSwapInterval]; |
170 [glContext setView:self]; | 174 [glContext setView:self]; |
171 [glContext makeCurrentContext]; | 175 [glContext makeCurrentContext]; |
176 } | |
177 | |
178 - (void) dealloc | |
179 { | |
172 [glContext release]; | 180 [glContext release]; |
173 } | |
174 | |
175 - (void) dealloc | |
176 { | |
177 [self setOpenGLContext:nil]; | 181 [self setOpenGLContext:nil]; |
178 [super dealloc]; | 182 [super dealloc]; |
179 } | 183 } |
180 | 184 |
181 - (void) config:(uint32_t)width:(uint32_t)height:(uint32_t)flags | 185 - (void) config:(uint32_t)width:(uint32_t)height:(uint32_t)flags |