mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-31 10:29:10 +00:00
Add: [OSX] Automatic zoom level suggestion for Cocoa video driver.
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user