v/vlib/gg/gg_darwin.m

15 lines
464 B
Matlab
Raw Normal View History

2020-12-03 23:17:00 +01:00
#include <Cocoa/Cocoa.h>
gg__Size gg_get_screen_size() {
NSScreen *screen = [NSScreen mainScreen];
NSDictionary *description = [screen deviceDescription];
NSSize displayPixelSize = [[description objectForKey:NSDeviceSize] sizeValue];
CGSize displayPhysicalSize = CGDisplayScreenSize(
[[description objectForKey:@"NSScreenNumber"] unsignedIntValue]);
gg__Size res;
res.width = displayPixelSize.width;
res.height = displayPixelSize.height;
return res;
}