Commit 4b2e143f authored by Felix Paul Kühne's avatar Felix Paul Kühne

vout_macosx: restore compilation support for OS X 10.5 and 10.6

parent 405a83cd
...@@ -53,6 +53,17 @@ ...@@ -53,6 +53,17 @@
- (BOOL)isFullscreen; - (BOOL)isFullscreen;
@end @end
/* compilation support for 10.5 and 10.6 */
#define OSX_LION NSAppKitVersionNumber >= 1115.2
#ifndef MAC_OS_X_VERSION_10_7
@interface NSView (IntroducedInLion)
- (NSRect)convertRectToBacking:(NSRect)aRect;
- (void)setWantsBestResolutionOpenGLSurface:(BOOL)aBool;
@endif
#endif
/** /**
* Forward declarations * Forward declarations
*/ */
...@@ -391,7 +402,7 @@ static int Control (vout_display_t *vd, int query, va_list ap) ...@@ -391,7 +402,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
{ {
NSRect bounds; NSRect bounds;
/* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */ /* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */
if ([sys->glView respondsToSelector:@selector(convertRectToBacking:)]) if (OSX_LION)
bounds = [sys->glView convertRectToBacking:[sys->glView bounds]]; bounds = [sys->glView convertRectToBacking:[sys->glView bounds]];
else else
bounds = [sys->glView bounds]; bounds = [sys->glView bounds];
...@@ -512,7 +523,7 @@ static void OpenglSwap (vlc_gl_t *gl) ...@@ -512,7 +523,7 @@ static void OpenglSwap (vlc_gl_t *gl)
return nil; return nil;
/* enable HiDPI support on OS X 10.7 and later */ /* enable HiDPI support on OS X 10.7 and later */
if ([self respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) if (OSX_LION)
[self setWantsBestResolutionOpenGLSurface:YES]; [self setWantsBestResolutionOpenGLSurface:YES];
/* Swap buffers only during the vertical retrace of the monitor. /* Swap buffers only during the vertical retrace of the monitor.
...@@ -533,7 +544,7 @@ static void OpenglSwap (vlc_gl_t *gl) ...@@ -533,7 +544,7 @@ static void OpenglSwap (vlc_gl_t *gl)
NSView *parentView = [value pointerValue]; NSView *parentView = [value pointerValue];
NSRect frame; NSRect frame;
/* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */ /* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */
if ([parentView respondsToSelector:@selector(convertRectToBacking:)]) if (OSX_LION)
frame = [parentView convertRectToBacking:[parentView bounds]]; frame = [parentView convertRectToBacking:[parentView bounds]];
else else
frame = [parentView bounds]; frame = [parentView bounds];
...@@ -635,7 +646,7 @@ static void OpenglSwap (vlc_gl_t *gl) ...@@ -635,7 +646,7 @@ static void OpenglSwap (vlc_gl_t *gl)
NSRect bounds; NSRect bounds;
/* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */ /* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */
if ([self respondsToSelector:@selector(convertRectToBacking:)]) if (OSX_LION)
bounds = [self convertRectToBacking:[self bounds]]; bounds = [self convertRectToBacking:[self bounds]];
else else
bounds = [self bounds]; bounds = [self bounds];
...@@ -773,7 +784,7 @@ static void OpenglSwap (vlc_gl_t *gl) ...@@ -773,7 +784,7 @@ static void OpenglSwap (vlc_gl_t *gl)
BOOL b_inside; BOOL b_inside;
/* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */ /* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */
if ([self respondsToSelector:@selector(convertRectToBacking:)]) if (OSX_LION)
s_rect = [self convertRectToBacking:[self bounds]]; s_rect = [self convertRectToBacking:[self bounds]];
else else
s_rect = [self bounds]; s_rect = [self bounds];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment