diff --git a/source/Cosmos.System2/Graphics/VGACanvas.cs b/source/Cosmos.System2/Graphics/VGACanvas.cs index 8b80bf4a03..4337857521 100644 --- a/source/Cosmos.System2/Graphics/VGACanvas.cs +++ b/source/Cosmos.System2/Graphics/VGACanvas.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Text; using Cosmos.HAL; @@ -16,6 +16,7 @@ public class VGACanvas : Canvas /// Private boolean whether VGA graphics mode is enabled or not /// bool _Enabled; + private Mode _Mode; /// /// The HAL VGA driver @@ -55,7 +56,14 @@ public VGACanvas() : base() /// /// Gets or sets the VGA graphics mode /// - public override Mode Mode { get; set; } + public override Mode Mode + { + get => _Mode; set + { + _VGADriver.SetGraphicsMode(ModeToScreenSize(_Mode), (VGADriver.ColorDepth)(int)_Mode.ColorDepth); + _Mode = value; + } + } /// /// Clears the screen of all pixels @@ -83,6 +91,7 @@ public override void Disable() { if (Enabled) { + VGAScreen.SetTextMode(TextSize.Size80x25); Enabled = false; } }