summaryrefslogtreecommitdiff
path: root/src/video/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'src/video/cocoa')
-rw-r--r--src/video/cocoa/cocoa_v.h1
-rw-r--r--src/video/cocoa/cocoa_v.mm6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/video/cocoa/cocoa_v.h b/src/video/cocoa/cocoa_v.h
index 596a9e27d..5dd3d1d1f 100644
--- a/src/video/cocoa/cocoa_v.h
+++ b/src/video/cocoa/cocoa_v.h
@@ -73,6 +73,7 @@ public:
protected:
Dimension GetScreenSize() const override;
+ float GetDPIScale() override;
private:
bool PollEvent();
diff --git a/src/video/cocoa/cocoa_v.mm b/src/video/cocoa/cocoa_v.mm
index c21edc7ac..4c6ce6cab 100644
--- a/src/video/cocoa/cocoa_v.mm
+++ b/src/video/cocoa/cocoa_v.mm
@@ -294,6 +294,12 @@ Dimension VideoDriver_Cocoa::GetScreenSize() const
return { static_cast<uint>(NSWidth(frame)), static_cast<uint>(NSHeight(frame)) };
}
+/** Get DPI scale of our window. */
+float VideoDriver_Cocoa::GetDPIScale()
+{
+ return this->cocoaview != nil ? [ this->cocoaview getContentsScale ] : 1.0f;
+}
+
/**
* Are we in fullscreen mode?
* @return whether fullscreen mode is currently used