mirror of
https://github.com/libretro/RetroArch
synced 2025-02-21 09:39:56 +00:00
fix ugly scaling on Retina Macs
This commit is contained in:
parent
5da6aeafd8
commit
b4e4af604e
@ -43,5 +43,7 @@
|
|||||||
<string>MainMenu</string>
|
<string>MainMenu</string>
|
||||||
<key>NSPrincipalClass</key>
|
<key>NSPrincipalClass</key>
|
||||||
<string>RApplication</string>
|
<string>RApplication</string>
|
||||||
|
<key>NSHighResolutionCapable</key>
|
||||||
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
@ -151,6 +151,7 @@ static bool cocoagl_gfx_ctx_init(void *data)
|
|||||||
|
|
||||||
#if defined(HAVE_COCOA)
|
#if defined(HAVE_COCOA)
|
||||||
CocoaView *g_view = (CocoaView*)nsview_get_ptr();
|
CocoaView *g_view = (CocoaView*)nsview_get_ptr();
|
||||||
|
[g_view setWantsBestResolutionOpenGLSurface:YES];
|
||||||
NSOpenGLPixelFormatAttribute attributes [] = {
|
NSOpenGLPixelFormatAttribute attributes [] = {
|
||||||
NSOpenGLPFAColorSize, 24,
|
NSOpenGLPFAColorSize, 24,
|
||||||
NSOpenGLPFADoubleBuffer,
|
NSOpenGLPFADoubleBuffer,
|
||||||
@ -337,8 +338,10 @@ static void cocoagl_gfx_ctx_get_video_size(void *data, unsigned* width, unsigned
|
|||||||
|
|
||||||
#if defined(HAVE_COCOA)
|
#if defined(HAVE_COCOA)
|
||||||
CocoaView *g_view = (CocoaView*)nsview_get_ptr();
|
CocoaView *g_view = (CocoaView*)nsview_get_ptr();
|
||||||
CGRect cgrect = NSRectToCGRect([g_view frame]);
|
NSRect backingBounds = [g_view convertRectToBacking:[g_view bounds]];
|
||||||
size = CGRectMake(0, 0, CGRectGetWidth(cgrect), CGRectGetHeight(cgrect));
|
GLsizei backingPixelWidth = (GLSizei)(backingBounds.size.width),
|
||||||
|
backingPixelHeight = (GLSizei)(backingBounds.size.height);
|
||||||
|
size = CGRectMake(0, 0, backingPixelWidth, backingPixelHeight);
|
||||||
#else
|
#else
|
||||||
size = g_view.bounds;
|
size = g_view.bounds;
|
||||||
#endif
|
#endif
|
||||||
@ -383,7 +386,7 @@ static bool cocoagl_gfx_ctx_get_metrics(void *data, enum display_metric_types ty
|
|||||||
#if MAC_OS_X_VERSION_10_6
|
#if MAC_OS_X_VERSION_10_6
|
||||||
float scale = screen.backingScaleFactor;
|
float scale = screen.backingScaleFactor;
|
||||||
#else
|
#else
|
||||||
float scale = 1.0f;
|
float scale = 4.0f;
|
||||||
#endif
|
#endif
|
||||||
float dpi = (display_width/ physical_width) * 25.4f * scale;
|
float dpi = (display_width/ physical_width) * 25.4f * scale;
|
||||||
#elif defined(HAVE_COCOATOUCH)
|
#elif defined(HAVE_COCOATOUCH)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user