Exemple #1
0
        protected override void Run()
        {
            switch (MouseManager.MouseState)
            {
            case MouseState.Left:
                Pressed = true;
                break;

            case MouseState.None:
                Pressed = false;
                break;
            }

            vMWareSVGAII.DoubleBuffer_Clear((uint)Color.Black.ToArgb());

            vMWareSVGAII.DoubleBuffer_DrawImage(bootBitmap, screenWidth / 2 - bootBitmap.Width / 2, screenHeight / 2 - bootBitmap.Height / 2);


            //vMWareSVGAII.DoubleBuffer_DrawImage(bitmap,0,0); Wallpaper

            foreach (App app in apps)
            {
                app.Update();
            }

            dock.Update();

            DrawCursor(vMWareSVGAII, MouseManager.X, MouseManager.Y);

            vMWareSVGAII.DoubleBuffer_Update();
        }
        protected override void BeforeRun()
        {
            CosmosVFS cosmosVFS = new CosmosVFS();

            VFSManager.RegisterVFS(cosmosVFS);

            bootBitmap = new Bitmap(@"0:\boot.bmp");

            vMWareSVGAII = new DoubleBufferedVMWareSVGAII();
            vMWareSVGAII.SetMode(screenWidth, screenHeight);

            vMWareSVGAII.DoubleBuffer_DrawImage(bootBitmap, 640 / 4, 0);
            vMWareSVGAII.DoubleBuffer_Update();

            bitmap      = new Bitmap(@"0:\timg.bmp");
            programlogo = new Bitmap(@"0:\program.bmp");

            uint r = 0;
            uint g = 0;
            uint b = 0;

            for (uint i = 0; i < bitmap.rawData.Length; i++)
            {
                Color color = Color.FromArgb(bitmap.rawData[i]);
                r += color.R;
                g += color.G;
                b += color.B;
            }
            avgCol = Color.FromArgb((int)(r / bitmap.rawData.Length), (int)(g / bitmap.rawData.Length), (int)(b / bitmap.rawData.Length));

            MouseManager.ScreenWidth  = screenWidth;
            MouseManager.ScreenHeight = screenHeight;
            MouseManager.X            = screenWidth / 2;
            MouseManager.Y            = screenHeight / 2;

            logView = new LogView(300, 200, 10, 30);
            Clock   = new Clock(200, 200, 400, 200);
            notepad = new Notepad(200, 100, 10, 300);
            dock    = new Dock();

            apps.Add(logView);
            apps.Add(Clock);
            apps.Add(notepad);
        }
Exemple #3
0
        protected override void BeforeRun()
        {
            CosmosVFS cosmosVFS = new CosmosVFS();

            VFSManager.RegisterVFS(cosmosVFS);

            bootBitmap = new Bitmap(@"0:\boot.bmp");

            vMWareSVGAII = new DoubleBufferedVMWareSVGAII();
            vMWareSVGAII.SetMode(screenWidth, screenHeight);

            vMWareSVGAII.DoubleBuffer_DrawImage(bootBitmap, screenWidth / 2 - bootBitmap.Width / 2, screenHeight / 2 - bootBitmap.Height / 2);
            vMWareSVGAII.DoubleBuffer_Update();

            //bitmap = new Bitmap(@"0:\timg.bmp"); Wallpaper

            programlogo = new Bitmap(@"0:\program.bmp");

            /*
             * uint r = 0;
             * uint g = 0;
             * uint b = 0;
             * for (uint i = 0; i < bitmap.rawData.Length; i++)
             * {
             *  Color color = Color.FromArgb(bitmap.rawData[i]);
             *  r += color.R;
             *  g += color.G;
             *  b += color.B;
             * }
             * avgCol = Color.FromArgb((int)(r / bitmap.rawData.Length), (int)(g / bitmap.rawData.Length), (int)(b / bitmap.rawData.Length));
             */
            avgCol = Color.DimGray;

            MouseManager.ScreenWidth  = screenWidth;
            MouseManager.ScreenHeight = screenHeight;

            console = new Console(400, 300, 40, 40);
            dock    = new Dock();

            apps.Add(console);
        }