示例#1
0
 protected override void BeforeRun()
 {
     VGADriverII.Initialize(VGAMode.Pixel320x200DB);
     draw.FromByteArray(System.Graphics.Images.BootScreen);
     VGAGraphics.DrawImage(0, 0, draw);
     VGAGraphics.Display();
     draw.FromByteArray(System.Graphics.Images.Cursor);
 }
示例#2
0
 public static void Run()
 {
     VGAGraphics.Clear(VGAColor.Black);
     //draw current window (windows are always fullscreen for now)
     if (!(windows.Count == 0))
     {
         windows[RunningIndex].Run();
     }
     //draw mouse
     VGAGraphics.DrawImage((int)MouseManager.X, (int)MouseManager.Y, VGAColor.Magenta, ImgCursor);
     VGADriverII.Display();
 }
示例#3
0
 public override void Run()
 {
     //draw gets called before run
     if (MouseOver)
     {
         VGAGraphics.DrawFilledRect(X, Y, Width, Height, HoverColor);
     }
     if (MouseOver && MouseManager.MouseState == MouseState.Left && !MousePreviouslyPressed)
     {
         MousePreviouslyPressed = true;
         VGAGraphics.DrawFilledRect(X, Y, Width, Height, ClickColor);
         EventArgs eventArgs = new EventArgs();
         OnMouseClick(eventArgs);
     }
 }
示例#4
0
 public static void Run()
 {
     VGAGraphics.Clear(VGAColor.Black);
     foreach (var window in windows)
     {
         window.Draw();
     }
     if (windows.Count != 0)
     {
         windows[RunningIndex].Run();
     }
     //draw mouse
     VGAGraphics.DrawImage((int)MouseManager.X, (int)MouseManager.Y, VGAColor.Magenta, ImgCursor);
     VGADriverII.Display();
 }
示例#5
0
        public override void Draw()
        {
            //called by window
            MouseOver = Intersect((int)MouseManager.X, (int)MouseManager.Y);

            if (MouseOver)
            {
                if (MouseManager.MouseState != MouseState.Left)
                {
                    MousePreviouslyPressed = false;
                }
            }
            else
            {
                VGAGraphics.DrawFilledRect(X, Y, Width, Height, Color);
            }
        }
示例#6
0
 public static void Run()
 {
     VGADriverII.Clear(247);
     VGAGraphics.DrawString(0, 0, "Cosix Graphics Manager", VGAColor.Black, VGAFont.Font8x8);
     VGAGraphics.DrawFilledRect(300, 180, 20, 20, VGAColor.Red);
     VGAGraphics.DrawFilledRect((int)MouseManager.X, (int)MouseManager.Y, 2, 2, VGAColor.Blue);
     if (vstate == 2)
     {
         VGAGraphics.Display();
     }
     if ((MouseManager.X > 300) & (MouseManager.Y > 180) & (MouseManager.MouseState == MouseState.Left))
     {
         GoText();
         Terminal.TextColor = ConsoleColor.White;
         Terminal.BackColor = ConsoleColor.Black;
         Terminal.Clear();
     }
 }
示例#7
0
 public static void Crash(Exception e)
 {
     if (Modules.CGM.VStateGet() == 0)
     {
         Terminal.Clear(ConsoleColor.DarkRed);
         Terminal.WriteLine("A fatal exception occured!");
         Terminal.WriteLine(e.ToString());
         Terminal.WriteLine("Please report this to the Cosix devs.");
         Terminal.DisableCursor();
         while (true)
         {
             if (Sys.KeyboardManager.ControlPressed)
             {
                 Terminal.BackColor = ConsoleColor.Black;
                 Terminal.Clear();
                 Terminal.EnableCursor();
                 break;
             }
             if (Sys.KeyboardManager.ShiftPressed)
             {
                 Restart();
             }
         }
     }
     else
     {
         VGADriverII.Clear(229);
         VGAGraphics.DrawString(0, 0, "A fatal exception occured!\n" + e.ToString() + "\nPlease report this to the Cosix devs.", VGAColor.White, VGAFont.Font8x8);
         if (Modules.CGM.VStateGet() == 2)
         {
             VGADriverII.Display();
         }
         while (true)
         {
         }
     }
 }
示例#8
0
 protected override void Run()
 {
     VGADriverII.Clear(206);
     VGAGraphics.DrawImage((int)Sys.MouseManager.X, (int)Sys.MouseManager.Y, draw);
     VGADriverII.Display();
 }
示例#9
0
 private static void DrawTaskbar()
 {
     VGAGraphics.DrawFilledRect(0, 300, 200, 20, VGAColor.Gray3);
 }
示例#10
0
 private static void DrawWallpaper()
 {
     VGAGraphics.Clear(VGAColor.Cyan7);
 }
示例#11
0
 private static void DrawBackground()
 {
     VGAGraphics.Clear(VGAColor.Blue3);
 }