Пример #1
0
    private static void Main(string[] args)
    {
      if (Debugger.IsAttached)
      {
        // The debugger is attached. The debugger will display any exception messages.

        // Run the XNA game.
        using (SampleGame game = new SampleGame())
          game.Run();
      }
      else
      {
        // The debugger is NOT attached. Use a MessageBox to display any exception messages.

        try
        {
          // Run the XNA game.
          using (SampleGame game = new SampleGame())
            game.Run();
        }
        catch (Exception exception)
        {
          MessageBox.Show(SampleHelper.GetExceptionMessage(exception), "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
      }
    }
Пример #2
0
        private static void Main(string[] args)
        {
            if (Debugger.IsAttached)
            {
                // The debugger is attached. The debugger will display any exception messages.

                // Run the XNA game.
                using (SampleGame game = new SampleGame())
                    game.Run();
            }
            else
            {
                // The debugger is NOT attached. Use a MessageBox to display any exception messages.

                try
                {
                    // Run the XNA game.
                    using (SampleGame game = new SampleGame())
                        game.Run();
                }
                catch (Exception exception)
                {
                    MessageBox.Show(SampleHelper.GetExceptionMessage(exception), "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
            }
        }
Пример #3
0
 protected override void OnCreate(Bundle bundle)
 {
   base.OnCreate(bundle);
   var g = new SampleGame();
   SetContentView((View)g.Services.GetService(typeof(View)));
   g.Run();
 }
Пример #4
0
        public GamePage(LaunchActivatedEventArgs args)
        {
            this.InitializeComponent();

            // Create the game.
            _game = XamlGame<SampleGame>.Create(args, Window.Current.CoreWindow, this);
        }
Пример #5
0
    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    private static void Main(string[] args)
    {
      if (Debugger.IsAttached)
      {
        // The debugger is attached. The debugger will display any exception messages.

        // Run the XNA game.
        using (SampleGame game = new SampleGame())
          game.Run();
      }
      else
      {
        // The debugger is NOT attached. Use the ExceptionGame to display any 
        // exception messages. (This is the only method to display the message on 
        // the Xbox. On Windows we could use a Windows MessageBox.)

        try
        {
          // Run the XNA game.
          using (SampleGame game = new SampleGame())
            game.Run();
        }
        catch (Exception exception)
        {
          using (var game = new ExceptionGame())
          {
            game.Exception = exception;
            game.Run();
          }
        }
      }
    }
Пример #6
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 private static void Main(string[] args)
 {
   if (Debugger.IsAttached)
   {
     // The debugger is attached:
     // Run the XNA game and let the debugger handle any exception messages.
     using (var game = new SampleGame())
       game.Run();
   }
   else
   {
     // The debugger is NOT attached:
     // Run the XNA game and use a MessageBox to display any exception messages.
     try
     {
       using (var game = new SampleGame())
         game.Run();
     }
     catch (Exception exception)
     {
       string message = SampleHelper.GetExceptionMessage(exception);
       MessageBox.Show(message, "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
   }
 }
Пример #7
0
        public GamePage(LaunchActivatedEventArgs args)
        {
            this.InitializeComponent();

            // Create the game.
            _game = XamlGame <SampleGame> .Create(args, Window.Current.CoreWindow, this);
        }
Пример #8
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        private static void Main(string[] args)
        {
            if (Debugger.IsAttached)
            {
                // The debugger is attached. The debugger will display any exception messages.

                // Run the XNA game.
                using (SampleGame game = new SampleGame())
                    game.Run();
            }
            else
            {
                // The debugger is NOT attached. Use the ExceptionGame to display any
                // exception messages. (This is the only method to display the message on
                // the Xbox. On Windows we could use a Windows MessageBox.)

                try
                {
                    // Run the XNA game.
                    using (SampleGame game = new SampleGame())
                        game.Run();
                }
                catch (Exception exception)
                {
                    using (var game = new ExceptionGame())
                    {
                        game.Exception = exception;
                        game.Run();
                    }
                }
            }
        }
Пример #9
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 private static void Main(string[] args)
 {
     if (Debugger.IsAttached)
     {
         // The debugger is attached:
         // Run the XNA game and let the debugger handle any exception messages.
         using (var game = new SampleGame())
             game.Run();
     }
     else
     {
         // The debugger is NOT attached:
         // Run the XNA game and use a MessageBox to display any exception messages.
         try
         {
             using (var game = new SampleGame())
                 game.Run();
         }
         catch (Exception exception)
         {
             string message = SampleHelper.GetExceptionMessage(exception);
             MessageBox.Show(message, "Unexpected Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
 }
Пример #10
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            var g = new SampleGame();

            SetContentView((View)g.Services.GetService(typeof(View)));
            g.Run();
        }
Пример #11
0
    public GamePage()
    {
      this.InitializeComponent();

      // Create the game.
      var launchArguments = string.Empty;
      _game = MonoGame.Framework.XamlGame<SampleGame>.Create(launchArguments, Window.Current.CoreWindow, swapChainPanel);
    }
Пример #12
0
        public GamePage()
        {
            this.InitializeComponent();

            // Create the game.
            var launchArguments = string.Empty;

            _game = MonoGame.Framework.XamlGame <SampleGame> .Create(launchArguments, Window.Current.CoreWindow, swapChainPanel);
        }
Пример #13
0
        //--------------------------------------------------------------
        #region Creation & Cleanup
        //--------------------------------------------------------------

        /// <summary>
        /// Initializes a new instance of the <see cref="SampleFramework" /> class.
        /// </summary>
        /// <param name="game">The XNA game.</param>
        /// <param name="initialSample">The type of the first sample.</param>
        public SampleFramework(SampleGame game, Type initialSample)
        {
            _game          = game;
            _initialSample = initialSample;

            // Get all required services.
            _services          = (ServiceContainer)ServiceLocator.Current;
            _inputService      = ServiceLocator.Current.GetInstance <IInputService>();
            _graphicsService   = _services.GetInstance <IGraphicsService>();
            _gameObjectService = _services.GetInstance <IGameObjectService>();

            InitializeSamples();
            InitializeController();
            InitializeMouse();
            InitializeProfiler();
            InitializeGui();
        }
Пример #14
0
        public GamePage(string launchArguments)
        {
            this.InitializeComponent();

            _game = XamlGame <SampleGame> .Create(launchArguments, Window.Current.CoreWindow, this);
        }
Пример #15
0
 public override bool FinishedLaunching(UIApplication app, NSDictionary options)
 {
     game = new SampleGame();
     game.Run();
     return(true);
 }
Пример #16
0
 public override bool FinishedLaunching (UIApplication app, NSDictionary options)
 {
   game = new SampleGame();
   game.Run();
   return true;
 }
Пример #17
0
 public override void FinishedLaunching(MonoMac.Foundation.NSObject notification)
 {
     game = new SampleGame();
     game.Run();
 }
Пример #18
0
    //--------------------------------------------------------------
    #region Creation & Cleanup
    //--------------------------------------------------------------

    /// <summary>
    /// Initializes a new instance of the <see cref="SampleFramework" /> class.
    /// </summary>
    /// <param name="game">The XNA game.</param>
    /// <param name="initialSample">The type of the first sample.</param>
    public SampleFramework(SampleGame game, Type initialSample)
    {
      _game = game;
      _initialSample = initialSample;

      // Get all required services.
      _services = (ServiceContainer)ServiceLocator.Current;
      _inputService = ServiceLocator.Current.GetInstance<IInputService>();
      _graphicsService = _services.GetInstance<IGraphicsService>();
      _gameObjectService = _services.GetInstance<IGameObjectService>();

      InitializeSamples();
      InitializeController();
      InitializeMouse();
      InitializeProfiler();
      InitializeGui();
    }
Пример #19
0
        public GamePage(string launchArguments)
        {
            this.InitializeComponent();

            _game = XamlGame<SampleGame>.Create(launchArguments, Window.Current.CoreWindow, this);
        }
Пример #20
0
		public override void FinishedLaunching (MonoMac.Foundation.NSObject notification)
		{			
			game = new SampleGame ();
			game.Run ();
		}