mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
Revert "Add OSX implementation for cocoagl_gfx_ctx_get_native_scale"
This reverts commit a408a5e59a57627b3ea9440e1ec26f04ad25c552.
This commit is contained in:
parent
a408a5e59a
commit
51426f64c2
@ -299,7 +299,7 @@ static bool cocoagl_gfx_ctx_set_video_mode(void *data,
|
|||||||
|
|
||||||
(void)data;
|
(void)data;
|
||||||
|
|
||||||
/* TODO: Maybe iOS users should be able to show/hide the status bar here? */
|
// TODO: Maybe iOS users should be able to show/hide the status bar here?
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -326,19 +326,12 @@ float cocoagl_gfx_ctx_get_native_scale(void)
|
|||||||
if (!screen)
|
if (!screen)
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
|
|
||||||
#if TARGET_OS_IPHONE
|
|
||||||
if ([screen respondsToSelector:selector])
|
if ([screen respondsToSelector:selector])
|
||||||
return cocoagl_gfx_ctx_get_scale_from_selector(screen, selector, &ret);
|
return cocoagl_gfx_ctx_get_scale_from_selector(screen, selector, &ret);
|
||||||
#endif
|
|
||||||
|
|
||||||
ret = 1.0f;
|
ret = 1.0f;
|
||||||
#if TARGET_OS_IPHONE
|
|
||||||
if ([screen respondsToSelector:@selector(scale)])
|
if ([screen respondsToSelector:@selector(scale)])
|
||||||
ret = screen.scale;
|
ret = screen.scale;
|
||||||
#elif MAC_OS_X_VERSION_10_7
|
|
||||||
if (screen.backingScaleFactor > 1.0f)
|
|
||||||
ret = screen.backingScaleFactor;
|
|
||||||
#endif
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -404,7 +397,7 @@ static bool cocoagl_gfx_ctx_get_metrics(void *data, enum display_metric_types ty
|
|||||||
#if MAC_OS_X_VERSION_10_7
|
#if MAC_OS_X_VERSION_10_7
|
||||||
float scale = screen.backingScaleFactor;
|
float scale = screen.backingScaleFactor;
|
||||||
#else
|
#else
|
||||||
float scale = 1.0f;
|
float scale = 1.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)
|
||||||
|
@ -31,8 +31,6 @@
|
|||||||
|
|
||||||
static id apple_platform;
|
static id apple_platform;
|
||||||
|
|
||||||
extern float cocoagl_gfx_ctx_get_native_scale(void);
|
|
||||||
|
|
||||||
void apple_rarch_exited(void)
|
void apple_rarch_exited(void)
|
||||||
{
|
{
|
||||||
[[NSApplication sharedApplication] terminate:nil];
|
[[NSApplication sharedApplication] terminate:nil];
|
||||||
@ -111,12 +109,17 @@ void apple_rarch_exited(void)
|
|||||||
case NSOtherMouseDragged:
|
case NSOtherMouseDragged:
|
||||||
{
|
{
|
||||||
NSPoint pos;
|
NSPoint pos;
|
||||||
NSPoint mouse_pos;
|
NSPoint mouse_pos;
|
||||||
CGFloat backing_scale_factor = cocoagl_gfx_ctx_get_native_scale();
|
|
||||||
/* Relative */
|
/* Relative */
|
||||||
apple->mouse_rel_x = event.deltaX;
|
apple->mouse_rel_x = event.deltaX;
|
||||||
apple->mouse_rel_y = event.deltaY;
|
apple->mouse_rel_y = event.deltaY;
|
||||||
|
|
||||||
|
#if MAC_OS_X_VERSION_10_7
|
||||||
|
RAScreen *screen = [RAScreen mainScreen];
|
||||||
|
CGFloat backing_scale_factor = screen.backingScaleFactor;
|
||||||
|
#else
|
||||||
|
CGFloat backing_scale_factor = 1.0f;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Absolute */
|
/* Absolute */
|
||||||
pos = [[CocoaView get] convertPoint:[event locationInWindow] fromView:nil];
|
pos = [[CocoaView get] convertPoint:[event locationInWindow] fromView:nil];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user