From 7728692e7361f4cbd552d0f59660cd5ff20b4d50 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 22 Nov 2013 16:38:19 +0100 Subject: [PATCH] (OSX) Make apple_gfx_ctx_get_video_size backwards compatible with OSX 10.6 --- apple/common/RAGameView.m | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apple/common/RAGameView.m b/apple/common/RAGameView.m index 60dc293189..21273660f6 100644 --- a/apple/common/RAGameView.m +++ b/apple/common/RAGameView.m @@ -365,7 +365,20 @@ bool apple_gfx_ctx_set_video_mode(unsigned width, unsigned height, bool fullscre void apple_gfx_ctx_get_video_size(unsigned* width, unsigned* height) { RAScreen* screen = get_chosen_screen(); - CGRect size = g_initialized ? g_view.bounds : screen.bounds; + CGRect size; + + if (g_initialized) + { +#if defined(OSX) && !defined(MAC_OS_X_VERSION_10_7) + CGRect cgrect = NSRectToCGRect(g_view.frame); + size = CGRectMake(0, 0, CGRectGetWidth(cgrect), CGRectGetHeight(cgrect)); +#else + size = g_view.bounds; +#endif + } + else + size = screen.bounds; + *width = CGRectGetWidth(size) * screen.scale; *height = CGRectGetHeight(size) * screen.scale;