(OSX) Make apple_gfx_ctx_get_video_size backwards compatible with OSX 10.6
This commit is contained in:
parent
d45bf7db1f
commit
7728692e73
|
@ -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)
|
void apple_gfx_ctx_get_video_size(unsigned* width, unsigned* height)
|
||||||
{
|
{
|
||||||
RAScreen* screen = get_chosen_screen();
|
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;
|
*width = CGRectGetWidth(size) * screen.scale;
|
||||||
*height = CGRectGetHeight(size) * screen.scale;
|
*height = CGRectGetHeight(size) * screen.scale;
|
||||||
|
|
Loading…
Reference in New Issue