/// <summary> /// Initialize the GuiEngine /// </summary> /// <param name="content">Content</param> /// <param name="graphics">GraphicsDeviceManager</param> public GuiEngine(ContentManager content, GraphicsDevice graphics, Int32 clientWidth, Int32 clientHeight) { this.Content = content; this.GraphicsDevice = graphics; this.SpriteBatch = new SpriteBatch(this.GraphicsDevice); this.DisposeEngine = false; this.ClientWidth = clientWidth; this.ClientHeight = clientHeight; // Load resources this.Loader = new Loader(this.Content); this.Loader.LoadContent(); // Initialize GuiFont this.Font = this.Loader.Font; // Initialize windows list this.lstWindows = new List<Window>(); }
/// <summary> /// Dispose the GuiEngine /// </summary> public void Dispose() { foreach (Window _window in this.lstWindows) { _window.Dispose(); } this.lstWindows.Clear(); this.CurrentWindow = null; this.Loader.Dispose(); this.Loader = null; this.DisposeEngine = true; }