diff --git a/MLEM.Startup/MlemGame.cs b/MLEM.Startup/MlemGame.cs index 9a5d228..e2f0c7d 100644 --- a/MLEM.Startup/MlemGame.cs +++ b/MLEM.Startup/MlemGame.cs @@ -72,7 +72,7 @@ namespace MLEM.Startup { this.SpriteBatch = new SpriteBatch(this.GraphicsDevice); this.InputHandler = new InputHandler(this); this.Components.Add(this.InputHandler); - this.UiSystem = new UiSystem(this, this.GraphicsDevice, new UntexturedStyle(this.SpriteBatch), this.InputHandler); + this.UiSystem = new UiSystem(this, new UntexturedStyle(this.SpriteBatch), this.InputHandler); this.Components.Add(this.UiSystem); this.OnLoadContent?.Invoke(this); } diff --git a/MLEM.Ui/Elements/Panel.cs b/MLEM.Ui/Elements/Panel.cs index cc1d0f9..c9bda1a 100644 --- a/MLEM.Ui/Elements/Panel.cs +++ b/MLEM.Ui/Elements/Panel.cs @@ -230,7 +230,7 @@ namespace MLEM.Ui.Elements { if (this.renderTarget == null || targetArea.Width != this.renderTarget.Width || targetArea.Height != this.renderTarget.Height) { if (this.renderTarget != null) this.renderTarget.Dispose(); - this.renderTarget = targetArea.IsEmpty ? null : new RenderTarget2D(this.System.GraphicsDevice, targetArea.Width, targetArea.Height); + this.renderTarget = targetArea.IsEmpty ? null : new RenderTarget2D(this.System.Game.GraphicsDevice, targetArea.Width, targetArea.Height); } } diff --git a/MLEM.Ui/UiSystem.cs b/MLEM.Ui/UiSystem.cs index d935730..0ba7177 100644 --- a/MLEM.Ui/UiSystem.cs +++ b/MLEM.Ui/UiSystem.cs @@ -21,10 +21,6 @@ namespace MLEM.Ui { /// public class UiSystem : GameComponent { - /// - /// The graphics device that this ui system uses for its size calculations - /// - public readonly GraphicsDevice GraphicsDevice; private readonly List rootElements = new List(); /// @@ -177,13 +173,11 @@ namespace MLEM.Ui { /// Creates a new ui system with the given settings. /// /// The game - /// The graphics device that should be used for viewport calculations /// The style settings that this ui should have. Use for the default, untextured style. /// The input handler that this ui's should use. If none is supplied, a new input handler is created for this ui. /// If this value is set to true, the ui system's will be set automatically based on the 's size. Defaults to true. - public UiSystem(Game game, GraphicsDevice device, UiStyle style, InputHandler inputHandler = null, bool automaticViewport = true) : base(game) { + public UiSystem(Game game, UiStyle style, InputHandler inputHandler = null, bool automaticViewport = true) : base(game) { this.Controls = new UiControls(this, inputHandler); - this.GraphicsDevice = device; this.style = style; if (automaticViewport) {