diff options
author | Michael Lutz <michi@icosahedron.de> | 2021-01-03 15:23:08 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2021-01-03 21:20:28 +0100 |
commit | 4ce53cb85113956be318c12801d5663a26e3fef9 (patch) | |
tree | e2136e9f73b0611f08a5c946a6288abdf5881868 /src/video/cocoa/cocoa_v.h | |
parent | c860a247d3e21628a0ac799d4d99ae178bb8a4a3 (diff) | |
download | openttd-4ce53cb85113956be318c12801d5663a26e3fef9.tar.xz |
Fix: [OSX] Quitting in fullscreen mode would loose the original window size.
This replicates the behaviour on e.g. Windows, which saves the original window size.
Diffstat (limited to 'src/video/cocoa/cocoa_v.h')
-rw-r--r-- | src/video/cocoa/cocoa_v.h | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/video/cocoa/cocoa_v.h b/src/video/cocoa/cocoa_v.h index 52d26c847..f3e484b01 100644 --- a/src/video/cocoa/cocoa_v.h +++ b/src/video/cocoa/cocoa_v.h @@ -11,10 +11,16 @@ #define VIDEO_COCOA_H #include "../video_driver.hpp" +#include "../../core/geometry_type.hpp" + extern bool _cocoa_video_started; class VideoDriver_Cocoa : public VideoDriver { +private: + bool fullscreen_on_mainloop; ///< Switch to fullscreen once the main loop is running? + Dimension orig_res; ///< Saved window size for non-fullscreen mode. + public: const char *Start(const StringList ¶m) override; @@ -59,6 +65,16 @@ public: * @return driver name */ const char *GetName() const override { return "cocoa"; } + + /* --- The following methods should be private, but can't be due to Obj-C limitations. --- */ + + /** Main game loop. */ + void GameLoop(); // In event.mm. + +private: + friend class WindowQuartzSubdriver; + + void GameSizeChanged(); }; class FVideoDriver_Cocoa : public DriverFactoryBase { @@ -190,10 +206,6 @@ extern CocoaSubdriver *_cocoa_subdriver; CocoaSubdriver *QZ_CreateWindowQuartzSubdriver(int width, int height, int bpp); -void QZ_GameSizeChanged(); - -void QZ_GameLoop(); - uint QZ_ListModes(OTTD_Point *modes, uint max_modes, CGDirectDisplayID display_id, int display_depth); #endif /* VIDEO_COCOA_H */ |