Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2013-01-08 21:27:11 +0400
committerTon Roosendaal <ton@blender.org>2013-01-08 21:27:11 +0400
commit74d85d28827207901aeec37ca6c93939e938c462 (patch)
tree92d6656da6620ef1905f6a9251c26f8f25190d37 /intern
parentfd35b0aa669155bfa503997f82151d822fff574b (diff)
Macbook HiDPI support: reshuffled code to make it compile for 10.6 and work
in 10.7 and later. OS X Gurus might check though :)
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_WindowCocoa.mm19
1 files changed, 14 insertions, 5 deletions
diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm
index 2d58f0612ce..40b9dcaf94e 100644
--- a/intern/ghost/intern/GHOST_WindowCocoa.mm
+++ b/intern/ghost/intern/GHOST_WindowCocoa.mm
@@ -428,6 +428,13 @@ extern "C" {
#pragma mark initialization / finalization
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
+@interface NSView (NSOpenGLSurfaceResolution)
+- (BOOL)wantsBestResolutionOpenGLSurface;
+- (void)setWantsBestResolutionOpenGLSurface;
+@end
+#endif
+
NSOpenGLContext* GHOST_WindowCocoa::s_firstOpenGLcontext = nil;
GHOST_WindowCocoa::GHOST_WindowCocoa(
@@ -579,13 +586,15 @@ GHOST_WindowCocoa::GHOST_WindowCocoa(
setDrawingContextType(type);
updateDrawingContext();
activateDrawingContext();
-#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070 // retina support started with 10.7.4 afaik
+
if (m_systemCocoa->m_nativePixel) {
- [m_openGLView setWantsBestResolutionOpenGLSurface:YES];
- NSRect backingBounds = [m_openGLView convertRectToBacking:[m_openGLView bounds]];
- m_systemCocoa->m_nativePixelSize = (float)backingBounds.size.width / (float)rect.size.width;
+ if ([m_openGLView respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) {
+ [m_openGLView setWantsBestResolutionOpenGLSurface:YES];
+
+ NSRect backingBounds = [m_openGLView convertRectToBacking:[m_openGLView bounds]];
+ m_systemCocoa->m_nativePixelSize = (float)backingBounds.size.width / (float)rect.size.width;
+ }
}
-#endif
m_tablet.Active = GHOST_kTabletModeNone;