private void InitializeMainWindow()
{
RectangleF frame = new RectangleF(
0, 0,
GraphicsDeviceManager.DefaultBackBufferWidth,
GraphicsDeviceManager.DefaultBackBufferHeight);
_mainWindow = new MacGameNSWindow(
frame, NSWindowStyle.Titled | NSWindowStyle.Closable | NSWindowStyle.Miniaturizable,
NSBackingStore.Buffered, true);
_mainWindow.WindowController = new NSWindowController(_mainWindow);
_mainWindow.Delegate = new MainWindowDelegate(this);
_mainWindow.IsOpaque = true;
_mainWindow.EnableCursorRects();
_mainWindow.AcceptsMouseMovedEvents = false;
_mainWindow.Center();
if (GameWindow.CreateWindowDelegate == null)
_gameWindow = new GameWindow(Game, frame);
else
_gameWindow = GameWindow.CreateWindowDelegate(Game, frame);
Window = _gameWindow;
_mainWindow.ContentView.AddSubview(_gameWindow);
}