1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/gg/gg_darwin.m
Alexander Medvednikov e160f6e7d2 gg: screen_size()
2020-12-03 23:17:00 +01:00

15 lines
464 B
Objective-C

#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;
}