Merge pull request #1777 from hizzlekizzle/master

Fix scaling on Retina Macs
This commit is contained in:
Twinaphex 2015-06-12 20:29:44 +02:00
commit 5886d18603
2 changed files with 7 additions and 2 deletions

View File

@ -43,5 +43,7 @@
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>RApplication</string>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>

View File

@ -151,6 +151,7 @@ static bool cocoagl_gfx_ctx_init(void *data)
#if defined(HAVE_COCOA)
CocoaView *g_view = (CocoaView*)nsview_get_ptr();
[g_view setWantsBestResolutionOpenGLSurface:YES];
NSOpenGLPixelFormatAttribute attributes [] = {
NSOpenGLPFAColorSize, 24,
NSOpenGLPFADoubleBuffer,
@ -337,8 +338,10 @@ static void cocoagl_gfx_ctx_get_video_size(void *data, unsigned* width, unsigned
#if defined(HAVE_COCOA)
CocoaView *g_view = (CocoaView*)nsview_get_ptr();
CGRect cgrect = NSRectToCGRect([g_view frame]);
size = CGRectMake(0, 0, CGRectGetWidth(cgrect), CGRectGetHeight(cgrect));
NSRect backingBounds = [g_view convertRectToBacking:[g_view bounds]];
GLsizei backingPixelWidth = (GLsizei)(backingBounds.size.width),
backingPixelHeight = (GLsizei)(backingBounds.size.height);
size = CGRectMake(0, 0, backingPixelWidth, backingPixelHeight);
#else
size = g_view.bounds;
#endif