OpenTTD Source 20260208-master-g43af8e94d0
cocoa_wnd.h File Reference

OS interface for the cocoa video driver. More...

import <Cocoa/Cocoa.h>

Go to the source code of this file.

Data Structures

category  NSCursor(OTTD_QuickdrawCursor)
 Category of NSCursor to allow cursor showing/hiding. More...
class  OTTD_CocoaWindow
 Subclass of NSWindow to cater our special needs. More...
class  OTTD_CocoaView
 Subclass of NSView to support mouse awareness and text input. More...
class  OTTD_CocoaWindowDelegate
 Delegate for our NSWindow to send ask for quit on close. More...

Enumerations

enum  RightMouseButtonEmulationState { RMBE_COMMAND = 0 , RMBE_CONTROL = 1 , RMBE_OFF = 2 }

Functions

bool CocoaSetupApplication ()
 Startup the application.
void CocoaExitApplication ()
 Deregister app delegate.

Variables

NSString * OTTDMainLaunchGameEngine
 Name of notification observer used to restart the game loop if necessary.
bool _allow_hidpi_window
 Storage for allow_hidpi setting. If true renders OTTD in native resolution.

Detailed Description

OS interface for the cocoa video driver.

Definition in file cocoa_wnd.h.

Enumeration Type Documentation

◆ RightMouseButtonEmulationState

enum RightMouseButtonEmulationState

Definition at line 18 of file cocoa_wnd.h.

Function Documentation

◆ CocoaExitApplication()

void CocoaExitApplication ( )

Deregister app delegate.

Definition at line 364 of file cocoa_wnd.mm.

References OTTDMain::unregisterObserver.

Referenced by VideoDriver_Cocoa::Stop().

◆ CocoaSetupApplication()

bool CocoaSetupApplication ( )

Startup the application.

Returns
True iff startup was successful.

Definition at line 328 of file cocoa_wnd.mm.

References _ottd_main, Debug, setApplicationMenu(), and setupWindowMenu().

Referenced by CocoaDialog(), and VideoDriver_Cocoa::Initialize().

Variable Documentation

◆ _allow_hidpi_window

bool _allow_hidpi_window
extern

Storage for allow_hidpi setting. If true renders OTTD in native resolution.

See also
table/misc_settings.ini

Definition at line 69 of file cocoa_wnd.mm.

◆ OTTDMainLaunchGameEngine

NSString* OTTDMainLaunchGameEngine
extern

Name of notification observer used to restart the game loop if necessary.

Definition at line 75 of file cocoa_wnd.mm.

Referenced by VideoDriver_Cocoa::MainLoop().