1
0
Fork 0

Add: [OSX] Automatic zoom level suggestion for Cocoa video driver.

pull/8556/head
Michael Lutz 2021-02-14 13:26:46 +01:00
parent f175e38666
commit 8d780e0607
2 changed files with 7 additions and 0 deletions

View File

@ -73,6 +73,7 @@ public:
protected: protected:
Dimension GetScreenSize() const override; Dimension GetScreenSize() const override;
float GetDPIScale() override;
private: private:
bool PollEvent(); bool PollEvent();

View File

@ -294,6 +294,12 @@ Dimension VideoDriver_Cocoa::GetScreenSize() const
return { static_cast<uint>(NSWidth(frame)), static_cast<uint>(NSHeight(frame)) }; 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? * Are we in fullscreen mode?
* @return whether fullscreen mode is currently used * @return whether fullscreen mode is currently used