internal void InternalCreateDevice(ExEnEmTouchGameView gameView) { // Switching from Portrait will be handled by ExEnEmTouchGameViewController ExEnScaler scaler = new ExEnScaler(ExEnInterfaceOrientation.Portrait, gameView.RenderbufferSize, gameView.DeviceSize); GraphicsDevice = new GraphicsDevice(scaler); OnDeviceCreated(this, EventArgs.Empty); }
internal void StartGame() { // Note: If the handling of the graphics device gets more complicated, // this may have to be split into functions around what needs to be done before, // during and after graphics device creation: ApplyChanges(); // Create the game's window and view: mainWindow = new UIWindow(UIScreen.MainScreen.Bounds); gameViewController = new ExEnEmTouchGameViewController(game, this); gameView = (ExEnEmTouchGameView)gameViewController.View; // Start the game gameView.StartGame(); // Calling StartGame does this: // - creates the frame buffer // - Calls InternalCreateDevice on this (creating the graphics device and calling DoDeviceCreated) // - calls Initialize and then Update/Draw on Game (to fill backbuffer before becoming visible) // Now that Game has started, make the window visible: mainWindow.Add(gameView); mainWindow.MakeKeyAndVisible(); }
public override void LoadView() { this.gameView = new ExEnEmTouchGameView(game, gdm); this.View = this.gameView; }
internal void InternalCreateDevice(ExEnEmTouchGameView gameView) { // Switching from Portrait will be handled by ExEnEmTouchGameViewController GraphicsDevice = new GraphicsDevice(gameView, UIInterfaceOrientation.Portrait); OnDeviceCreated(this, EventArgs.Empty); }