diff --git a/desmume/src/cocoa/userinterface/DisplayWindowController.mm b/desmume/src/cocoa/userinterface/DisplayWindowController.mm index 5528c998d..0d1836c78 100644 --- a/desmume/src/cocoa/userinterface/DisplayWindowController.mm +++ b/desmume/src/cocoa/userinterface/DisplayWindowController.mm @@ -1269,6 +1269,13 @@ static std::unordered_map _screenMap; // return self; } +#if defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) + if ([self respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) + { + [self setWantsBestResolutionOpenGLSurface:YES]; + } +#endif + inputManager = nil; // Initialize the OpenGL context @@ -1658,7 +1665,13 @@ static std::unordered_map _screenMap; // { [context update]; DisplayWindowController *windowController = (DisplayWindowController *)[[self window] delegate]; - [CocoaDSUtil messageSendOneWayWithRect:[[windowController cdsVideoOutput] receivePort] msgID:MESSAGE_RESIZE_VIEW rect:rect]; + +#if defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) + const NSRect newViewportRect = [self convertRectToBacking:rect]; +#else + const NSRect newViewportRect = rect; +#endif + [CocoaDSUtil messageSendOneWayWithRect:[[windowController cdsVideoOutput] receivePort] msgID:MESSAGE_RESIZE_VIEW rect:newViewportRect]; } } diff --git a/desmume/src/cocoa/userinterface/preferencesWindowDelegate.mm b/desmume/src/cocoa/userinterface/preferencesWindowDelegate.mm index 994422ea2..7284b62f6 100644 --- a/desmume/src/cocoa/userinterface/preferencesWindowDelegate.mm +++ b/desmume/src/cocoa/userinterface/preferencesWindowDelegate.mm @@ -50,6 +50,13 @@ return self; } +#if defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) + if ([self respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) + { + [self setWantsBestResolutionOpenGLSurface:YES]; + } +#endif + isPreviewImageLoaded = false; // Initialize the OpenGL context @@ -90,8 +97,14 @@ CGLContextObj prevContext = CGLGetCurrentContext(); CGLSetCurrentContext(cglDisplayContext); +#if defined(MAC_OS_X_VERSION_10_7) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7) + const NSRect newViewportRect = [self convertRectToBacking:frameRect]; +#else + const NSRect newViewportRect = frameRect; +#endif + OGLInfo *oglInfo = OGLInfoCreate_Func(); - oglImage = new OGLImage(oglInfo, 64, 64, frameRect.size.width, frameRect.size.height); + oglImage = new OGLImage(oglInfo, 64, 64, newViewportRect.size.width, newViewportRect.size.height); oglImage->SetFiltersPreferGPUOGL(true); oglImage->SetSourceDeposterize(false); oglImage->SetOutputFilterOGL(OutputFilterTypeID_Bilinear);