Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the FontRenderer class.
 /// </summary>
 public FontRenderer(Layer layer, Font font, int charWidth, int charHeight)
 {
     this.layer = layer;
     this.font = font;
     this.charWidth = charWidth;
     this.charHeight = charHeight;
 }
Esempio n. 2
0
File: Font.cs Progetto: ke2083/KOS
 public void Plot(char character, int x, int y, Layer layer, Colour colour)
 {
     var characterLines = charmap[character] as Line[];
     for (int i = 0; i < characterLines.Length; i++)
     {
         layer.DrawLine(characterLines[i].Start.X + x, characterLines[i].Start.Y + y, characterLines[i].End.X + x, characterLines[i].End.Y + y, colour);
     }
 }
Esempio n. 3
0
File: Canvas.cs Progetto: ke2083/KOS
        public int CreateLayer()
        {
            var newBuffer = new Layer[buffer.Length + 1];
            for (int i = 0; i < buffer.Length; i++)
            {
                newBuffer[i] = buffer[i];
            }

            var layer = new Layer(this.screen.Width, this.screen.Height);
            newBuffer[buffer.Length] = layer;
            buffer = newBuffer;
            return buffer.Length - 1;
        }
Esempio n. 4
0
File: Kernel.cs Progetto: ke2083/KOS
 protected override void BeforeRun()
 {
     var vga = new VGAScreen();
     vga.SetGraphicsMode(VGAScreen.ScreenSize.Size320x200, VGAScreen.ColorDepth.BitDepth8);
     screen = new Screen(vga);
     canvas = new Canvas(screen);
     canvas.Clear();
     mouse.Initialize();
     var ml = canvas.CreateLayer();
     mouseLayer = canvas.GetLayer(ml);
     //mouseLayer.DrawLine(0, 0, 200, 200, Colour.LimeGreen);
     //canvas.Redraw();
 }