diff options
author | okamstudio <juan@okamstudio.com> | 2014-02-20 23:37:01 -0200 |
---|---|---|
committer | okamstudio <juan@okamstudio.com> | 2014-02-20 23:37:01 -0200 |
commit | 44abe6bfd79164386853a7f02bb0d43148fcfc58 (patch) | |
tree | 8cf85eb08a4e462d46bf3175ff743492048cd2b3 | |
parent | 268eebe654ed394c060e5c5595e57e8bb0de72e1 (diff) | |
parent | 3974a5e84d3170f70481f7f68052ad53130d478b (diff) |
Merge pull request #124 from kevinhartman/master
Fixed OS X retina initial videomode size
-rw-r--r-- | platform/osx/os_osx.mm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/platform/osx/os_osx.mm b/platform/osx/os_osx.mm index 8dcba61c74..dda3527618 100644 --- a/platform/osx/os_osx.mm +++ b/platform/osx/os_osx.mm @@ -845,18 +845,17 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi /*** OSX INITIALIZATION ***/ /*** OSX INITIALIZATION ***/ /*** OSX INITIALIZATION ***/ - - current_videomode=p_desired; + window_delegate = [[GodotWindowDelegate alloc] init]; // Don't use accumulation buffer support; it's not accelerated // Aux buffers probably aren't accelerated either - unsigned int styleMask = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | (current_videomode.resizable?NSResizableWindowMask:0); + unsigned int styleMask = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | (p_desired.resizable?NSResizableWindowMask:0); window_object = [[GodotWindow alloc] - initWithContentRect:NSMakeRect(0, 0, current_videomode.width,current_videomode.height) + initWithContentRect:NSMakeRect(0, 0, p_desired.width, p_desired.height) styleMask:styleMask backing:NSBackingStoreBuffered defer:NO]; @@ -865,6 +864,13 @@ void OS_OSX::initialize(const VideoMode& p_desired,int p_video_driver,int p_audi window_view = [[GodotContentView alloc] init]; + current_videomode = p_desired; + + // Adjust for display density + const NSRect fbRect = convertRectToBacking(NSMakeRect(0, 0, p_desired.width, p_desired.height)); + current_videomode.width = fbRect.size.width; + current_videomode.height = fbRect.size.height; + #if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070 if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) { [window_view setWantsBestResolutionOpenGLSurface:YES]; |