Ejemplo n.º 1
0
        /// <summary>
        /// Start the main application loop. This method should be called from the entry point of the application
        /// </summary>
        public void Run()
        {
            if (xnaLogic != null)
            {
                throw new InvalidOperationException("Application is already initalised");
            }

            xnaLogic = new XNALogic(this, IntPtr.Zero, out gamerServicesComponent);

            xnaLogic.Services.AddService(typeof(ApplicationProviderService), new ApplicationProviderService(this));
            xnaLogic.Exiting += new EventHandler(ShutdownThreadPool);
            xnaLogic.Content.RootDirectory += @"\Content";

            content = new ContentRegister(this, xnaLogic.Content);
            content.Add(this);

            xnaLogic.Run();
        }
Ejemplo n.º 2
0
        internal void Run(GameComponentHost host)
        {
            if (host == null)
            {
                throw new ArgumentNullException();
            }
            if (xnaLogic != null)
            {
                throw new InvalidOperationException("Application is already initalised");
            }

            xnaLogic = new XNALogic(this, host, out this.gamerServicesComponent);
            xnaLogic.Services.AddService(typeof(ApplicationProviderService), new ApplicationProviderService(this));
            xnaLogic.Exiting += new EventHandler(ShutdownThreadPool);
            xnaLogic.Content.RootDirectory += @"\Content";

            content = new ContentRegister(this, xnaLogic.Content);
            content.Add(this);

            xnaLogic.Run();
        }