Exemple #1
0
        void host_Update(GameTime time, GameComponentHost component)
        {
            UpdateWindowSize();

            if (ticksSet == false)
            {
                initalTick      = time.TotalRealTime.Ticks;
                initialGameTick = time.TotalGameTime.Ticks;
                ticksSet        = true;
            }

            logic.Update(time.TotalRealTime.Ticks - initalTick, time.TotalGameTime.Ticks - initialGameTick);
        }
		public XnaGame(Application application)
		{
			//create the graphics device manager
			graphics = new GraphicsDeviceManager(this);
			graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;

			Content.RootDirectory = "Content";

			//create the xen host
			GameComponent component = new Xen.GameComponentHost(this, application, graphics);

			//add it to the xna component list
			this.Components.Add(component);
		}
Exemple #3
0
        public XnaGame(Application application)
        {
            //create the graphics device manager
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredDepthStencilFormat = DepthFormat.Depth24Stencil8;

            Content.RootDirectory = "Content";

            //create the xen host
            GameComponent component = new Xen.GameComponentHost(this, application, graphics);

            //add it to the xna component list
            this.Components.Add(component);
        }
Exemple #4
0
        internal XNAGameComponentHostAppWrapper(XNALogic logic, Application parent, GameComponentHost host)
        {
            this.parent = parent;
            this.logic  = logic;

            this.control = host;
            this.game    = host.Game;

            content = new ContentManager(game.Services);

            UpdateWindowSize();

            host.DrawEvent      += new GameEvent(host_Draw);
            host.UpdateEvent    += new GameEvent(host_Update);
            host.InitaliseEvent += new GameEvent(host_InitaliseEvent);
        }
Exemple #5
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();
        }
		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();
		}
		internal XNAGameComponentHostAppWrapper(XNALogic logic, Application parent, GameComponentHost host)
		{
			this.parent = parent;
			this.logic = logic;

			this.control = host;
			this.game = host.Game;

			content = new ContentManager(game.Services);

			UpdateWindowSize();

			host.DrawEvent += new GameEvent(host_Draw);
			host.UpdateEvent += new GameEvent(host_Update);
			host.InitaliseEvent += new GameEvent(host_InitaliseEvent);
		}
		void host_Draw(GameTime time, GameComponentHost component)
		{
			logic.Draw(true);
		}
		void host_Update(GameTime time, GameComponentHost component)
		{
			UpdateWindowSize();

			if (ticksSet == false)
			{
				initialGameTick = time.TotalGameTime.Ticks;
				ticksSet = true;
			}

			logic.Update(time, time.TotalGameTime.Ticks - initialGameTick);
		}
		void host_InitaliseEvent(GameTime time, GameComponentHost component)
		{
			logic.Initialise();
			logic.LoadContent();
		}
Exemple #11
0
 void host_Draw(GameTime time, GameComponentHost component)
 {
     logic.Draw(true);
 }
Exemple #12
0
 void host_InitaliseEvent(GameTime time, GameComponentHost component)
 {
     logic.Initialise();
     logic.LoadContent();
 }