diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2024-03-31 19:27:56 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2024-03-31 21:06:12 +0200 |
commit | 4947f735fbf035febbd8435c32a50d37af2633cb (patch) | |
tree | 162c912c0e9465a426da405265565317329899b0 /dggui/nativewindow_cocoa.mm | |
parent | aab05ac13b6fe094bb0dc7c5e50c5a76250aa131 (diff) |
Add isHiDPI function to NativeWindow and it's implementations.hidpi
Diffstat (limited to 'dggui/nativewindow_cocoa.mm')
-rw-r--r-- | dggui/nativewindow_cocoa.mm | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/dggui/nativewindow_cocoa.mm b/dggui/nativewindow_cocoa.mm index 3214f57..9484af7 100644 --- a/dggui/nativewindow_cocoa.mm +++ b/dggui/nativewindow_cocoa.mm @@ -609,6 +609,12 @@ std::pair<std::size_t, std::size_t> NativeWindowCocoa::getSize() const } } +bool NativeWindowCocoa::isHiDPI() +{ + float dpi = [priv->window backingScaleFactor]; + return dpi > 1.0f; +} + void NativeWindowCocoa::move(int x, int y) { NSRect screen = [[NSScreen mainScreen] frame]; |