コード例 #1
0
        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();
        }
コード例 #2
0
        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();
        }