示例#1
0
 void IContentOwner.LoadContent(ContentRegister content, DrawState state, ContentManager manager)
 {
     xnaLogic.state.GetRenderState(state.BeginGetGraphicsDevice(Xen.Graphics.State.StateFlag.None)).DirtyInternalRenderState(Xen.Graphics.State.StateFlag.All);
     state.EndGetGraphicsDevice();
     if (readToLoadContent)
     {
         this.LoadContent(state, manager);
     }
 }
示例#2
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();
        }
示例#3
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();
        }
示例#4
0
 void IContentOwner.UnloadContent(ContentRegister content, DrawState state)
 {
     xnaLogic.state.GetRenderState(state.BeginGetGraphicsDevice(Xen.Graphics.State.StateFlag.None)).DirtyInternalRenderState(Xen.Graphics.State.StateFlag.All);
     state.EndGetGraphicsDevice();
     this.UnloadContent(state);
 }