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); }
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); }
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(); }
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(); }