|
@@ -26,48 +26,50 @@ private:
|
|
|
|
|
|
public:
|
|
|
bool setup; ///< Window is currently being created.
|
|
|
|
|
|
OTTD_CocoaWindow *window; ///< Pointer to window object
|
|
|
OTTD_CocoaView *cocoaview; ///< Pointer to view object
|
|
|
CGColorSpaceRef color_space; ///< Window color space
|
|
|
|
|
|
OTTD_CocoaWindowDelegate *delegate; //!< Window delegate object
|
|
|
|
|
|
public:
|
|
|
VideoDriver_Cocoa();
|
|
|
|
|
|
void Stop() override;
|
|
|
void MainLoop() override;
|
|
|
|
|
|
void MakeDirty(int left, int top, int width, int height) override;
|
|
|
bool AfterBlitterChange() override;
|
|
|
|
|
|
bool ChangeResolution(int w, int h) override;
|
|
|
bool ToggleFullscreen(bool fullscreen) override;
|
|
|
|
|
|
void EditBoxLostFocus() override;
|
|
|
|
|
|
std::vector<int> GetListOfMonitorRefreshRates() override;
|
|
|
|
|
|
/* --- The following methods should be private, but can't be due to Obj-C limitations. --- */
|
|
|
|
|
|
void MainLoopReal();
|
|
|
|
|
|
virtual void AllocateBackingStore(bool force = false) = 0;
|
|
|
|
|
|
protected:
|
|
|
Rect dirty_rect; ///< Region of the screen that needs redrawing.
|
|
|
bool buffer_locked; ///< Video buffer was locked by the main thread.
|
|
|
|
|
|
Dimension GetScreenSize() const override;
|
|
|
float GetDPIScale() override;
|
|
|
void InputLoop() override;
|
|
|
bool LockVideoBuffer() override;
|
|
|
void UnlockVideoBuffer() override;
|
|
|
bool PollEvent() override;
|
|
|
|
|
|
void GameSizeChanged();
|
|
|
|
|
|
const char *Initialize();
|
|
|
|
|
|
void UpdateVideoModes();
|
|
|
|
|
|
bool MakeWindow(int width, int height);
|