/// <summary> /// Dispose the wrapper /// </summary> public void Dispose() { if (xnaGame != null) { xnaGame.Dispose(); xnaGame = null; } }
internal XNALogic(Application parent, object host, out Microsoft.Xna.Framework.GamerServices.GamerServicesComponent gamerServicesComponent) { this.state = new AppState(parent); this.parent = parent; parent.UpdateManager.Add(state); parent.UpdateManager.Add(parent); gamerServicesComponent = null; if (host is GameComponentHost) { this.xnaGame = new XNAGameComponentHostAppWrapper(this, parent, host as GameComponentHost); } else { #if !XBOX360 if (host == null) { this.xnaGame = new XNAGameAppWrapper(this, parent, out gamerServicesComponent); } else { WinFormsHostControl _host = host as WinFormsHostControl; if (_host != null) { this.xnaGame = new XNAWinFormsHostAppWrapper(this, parent, _host); } else { this.xnaGame = new XNAGameAppWrapper(this, parent, out gamerServicesComponent); } } #else this.xnaGame = new XNAGameAppWrapper(this, parent, out gamerServicesComponent); #endif } this.Exiting += delegate { Xen.Graphics.Resource.ClearResourceTracking(); }; }
internal XNALogic(Application parent, object host, out Microsoft.Xna.Framework.GamerServices.GamerServicesComponent gamerServicesComponent) { this.state = new AppState(parent); this.parent = parent; parent.UpdateManager.Add(state); parent.UpdateManager.Add(parent); gamerServicesComponent = null; if (host is GameComponentHost) { this.xnaGame = new XNAGameComponentHostAppWrapper(this, parent, host as GameComponentHost); } else { #if !XBOX360 if (host == null) { this.xnaGame = new XNAGameAppWrapper(this, parent, out gamerServicesComponent); } //else //{ // WinFormsHostControl _host = host as WinFormsHostControl; // if (_host != null) // this.xnaGame = new XNAWinFormsHostAppWrapper(this, parent, _host); // else // this.xnaGame = new XNAGameAppWrapper(this, parent, out gamerServicesComponent); //} #else this.xnaGame = new XNAGameAppWrapper(this, parent, out gamerServicesComponent); #endif } this.Exiting += delegate { Xen.Graphics.Resource.ClearResourceTracking(); }; }