diff --git a/src/SFML/Window/OSX/SFWindowController.mm b/src/SFML/Window/OSX/SFWindowController.mm index f6cb3e99b..069be59ba 100644 --- a/src/SFML/Window/OSX/SFWindowController.mm +++ b/src/SFML/Window/OSX/SFWindowController.mm @@ -181,7 +181,6 @@ { // Create a screen-sized window on the main display sf::VideoMode desktop = sf::VideoMode::getDesktopMode(); - sf::priv::scaleInWidthHeight(desktop, nil); NSRect windowRect = NSMakeRect(0, 0, desktop.width, desktop.height); m_window = [[SFWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask @@ -448,7 +447,6 @@ // Special case when fullscreen: only resize the opengl view // and make sure the requested size is not bigger than the window. sf::VideoMode desktop = sf::VideoMode::getDesktopMode(); - sf::priv::scaleInWidthHeight(desktop, nil); width = std::min(width, desktop.width); height = std::min(height, desktop.height); diff --git a/src/SFML/Window/OSX/Scaling.h b/src/SFML/Window/OSX/Scaling.h index d4b52c86c..0d5b71cb3 100644 --- a/src/SFML/Window/OSX/Scaling.h +++ b/src/SFML/Window/OSX/Scaling.h @@ -57,13 +57,6 @@ void scaleIn(T& in, id delegate) in /= static_cast(delegate ? [delegate displayScaleFactor] : getDefaultScaleFactor()); } -template -void scaleInWidthHeight(T& in, id delegate) -{ - scaleIn(in.width, delegate); - scaleIn(in.height, delegate); -} - template void scaleInXY(T& in, id delegate) { diff --git a/src/SFML/Window/OSX/cg_sf_conversion.mm b/src/SFML/Window/OSX/cg_sf_conversion.mm index 9d77a00fd..607734306 100644 --- a/src/SFML/Window/OSX/cg_sf_conversion.mm +++ b/src/SFML/Window/OSX/cg_sf_conversion.mm @@ -28,6 +28,7 @@ //////////////////////////////////////////////////////////// #include #include +#include #import @@ -95,11 +96,10 @@ VideoMode convertCGModeToSFMode(CGDisplayModeRef cgmode) // // [1]: "APIs for Supporting High Resolution" > "Additions and Changes for OS X v10.8" // https://developer.apple.com/library/mac/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/APIs/APIs.html#//apple_ref/doc/uid/TP40012302-CH5-SW27 - VideoMode mode(static_cast(CGDisplayModeGetWidth(cgmode)), static_cast(CGDisplayModeGetHeight(cgmode)), static_cast(modeBitsPerPixel(cgmode))); - scaleOutWidthHeight(mode, nil); - return mode; + Vector2u size = Vector2u(Vector2(CGDisplayModeGetPixelWidth(cgmode), CGDisplayModeGetPixelHeight(cgmode))); + scaleInXY(size, nil); + return VideoMode(size.x, size.y, static_cast(modeBitsPerPixel(cgmode))); } } // namespace priv } // namespace sf -