diff options
author | Davide Beatrici <davidebeatrici@gmail.com> | 2019-10-09 07:32:21 +0300 |
---|---|---|
committer | Davide Beatrici <davidebeatrici@gmail.com> | 2019-10-10 00:35:47 +0300 |
commit | 1571d91c0fa07970b64d72aa4ca8cd4360f25b2c (patch) | |
tree | 5f490823c3bc124f712a114261c4f2235cb7eda0 /overlay_gl/init_mac.c | |
parent | 57a8f3e48b6d7d41cf4d821dc788191552b31627 (diff) |
overlay_gl/init_mac.c: remove code based on CGDisplayIsCaptured()
The function was removed and there is no replacement: https://developer.apple.com/documentation/coregraphics/1562061-cgdisplayiscaptured
Retrieving the resolution directly from OpenGL is probably better anyway.
Diffstat (limited to 'overlay_gl/init_mac.c')
-rw-r--r-- | overlay_gl/init_mac.c | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/overlay_gl/init_mac.c b/overlay_gl/init_mac.c index 25869992e..4dfadab0e 100644 --- a/overlay_gl/init_mac.c +++ b/overlay_gl/init_mac.c @@ -38,19 +38,10 @@ width = (int)r.size.width; height = (int)r.size.height; } else { - if (AVAIL(CGMainDisplayID)) { - CGDirectDisplayID md = CGMainDisplayID(); - if (CGDisplayIsCaptured(md)) { - width = CGDisplayPixelsWide(md); - height = CGDisplayPixelsHigh(md); - } - } - if (!width && !height) { - GLint viewport[4]; - glGetIntegerv(GL_VIEWPORT, viewport); - width = viewport[2]; - height = viewport[3]; - } + GLint viewport[4]; + glGetIntegerv(GL_VIEWPORT, viewport); + width = viewport[2]; + height = viewport[3]; } drawContext(c, width, height); @@ -101,22 +92,13 @@ void CGLFlushDrawableOverride(CGLContextObj ctx) { newContext(c); } - int width = 0, height = 0; - if (AVAIL(CGMainDisplayID)) { - CGDirectDisplayID md = CGMainDisplayID(); - if (CGDisplayIsCaptured(md)) { - width = CGDisplayPixelsWide(md); - height = CGDisplayPixelsHigh(md); - } - } - if (!width && !height) { - GLint viewport[4]; - glGetIntegerv(GL_VIEWPORT, viewport); - width = viewport[2]; - height = viewport[3]; - /* Are the viewport values crazy? Skip them in that case. */ - if (height < 0 || width < 0 || height > 5000 || width > 5000) - goto skip; + GLint viewport[4]; + glGetIntegerv(GL_VIEWPORT, viewport); + int width = viewport[2]; + int height = viewport[3]; + /* Are the viewport values crazy? Skip them in that case. */ + if (height < 0 || width < 0 || height > 5000 || width > 5000) { + goto skip; } drawContext(c, width, height); |