/// <summary> /// Main constructor. Each instance of this class is a potential 'device', with its own screen size and events /// </summary> /// <param name="tag">The tag that will be asociated to the log messages of this instance</param> public VisualEngine(StringBuilder tag) { LogTag = tag; Log = new Log(); // Assign InternalPath if (InternalPath == null) { FindInternalDirectory(); } Log.SetFileOutput(InternalPath + "Log\\Log_" + LogTag + ".txt"); Log.AddInformation(LogTag, new StringBuilder("Creating the device")); Device = new GraphicsDevice(); Device.Initialize(tag.ToString(), InternalPath); Log.AddInformation(LogTag, new StringBuilder("Creating the Textures")); Textures = new Textures(this); RenderTargets = new RenderTargets(this); DepthStencils = new DepthStencils(this); RenderViews = new RenderViews(this); Sprites = new Sprites(this); }
/// <summary> /// Destroy and free all the resources /// </summary> public void Destroy() { DepthStencils.Destroy(); RenderTargets.Destroy(); Sprites.Destroy(); Textures.Destroy(); Device.Destroy(); Log.Destroy(); }