diff --git a/src/video/cocoa/cocoa_v.h b/src/video/cocoa/cocoa_v.h --- a/src/video/cocoa/cocoa_v.h +++ b/src/video/cocoa/cocoa_v.h @@ -16,13 +16,12 @@ extern bool _cocoa_video_started; +@class OTTD_CocoaWindowDelegate; + class VideoDriver_Cocoa : public VideoDriver { private: Dimension orig_res; ///< Saved window size for non-fullscreen mode. - int device_width; ///< Width of device in pixel - int device_height; ///< Height of device in pixel - int window_width; ///< Current window width in pixel int window_height; ///< Current window height in pixel int window_pitch; @@ -46,6 +45,8 @@ public: CGColorSpaceRef color_space; ///< Window color space CGContextRef cgcontext; ///< Context reference for Quartz subdriver + OTTD_CocoaWindowDelegate *delegate; //!< Window delegate object + public: VideoDriver_Cocoa(); @@ -69,7 +70,7 @@ public: /** Main game loop. */ void GameLoop(); // In event.mm. - bool WindowResized(); + void AllocateBackingStore(); protected: Dimension GetScreenSize() const override; @@ -85,8 +86,8 @@ private: void GameSizeChanged(); void UpdateVideoModes(); - void GetDeviceInfo(); - bool SetVideoMode(int width, int height, int bpp); + + bool MakeWindow(int width, int height); void UpdatePalette(uint first_color, uint num_colors); void CheckPaletteAnim();