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

pull/221/head
Michael Lutz 3 years ago
parent f175e38666
commit 8d780e0607

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

@ -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

Loading…
Cancel
Save