From 4947f735fbf035febbd8435c32a50d37af2633cb Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sun, 31 Mar 2024 19:27:56 +0200 Subject: Add isHiDPI function to NativeWindow and it's implementations. --- dggui/nativewindow_cocoa.mm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'dggui/nativewindow_cocoa.mm') 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 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]; -- cgit v1.2.3