Example #1
0
        private void Run()
        {
#if !DEBUG
            Program.AllocConsole();
            Console.Title = "Graphic Canvas - Interactive";
#endif
            Console.WriteLine("# GRAPHIC CANVAS INTERACTIVE #\nEnter any command in this command line and press enter.\n");

            Thread consoleThread = new Thread(new ThreadStart(ConsoleWorker));

            consoleThread.Start();
            window.Run(1.0 / 60.0);

            consoleThread.Abort();
            Program.FreeConsole();

            window.Dispose();
            canvas.Dispose();
            runtime.Dispose();
        }
Example #2
0
        public PlainViewer(string sourceFile, string title)
        {
            canvas  = new Canvas(512, 512);
            window  = new CanvasWindow(canvas, title);
            runtime = new Runtime(window, canvas, 99);
            vm      = new VirtualMachine();

            if (File.Exists(sourceFile))
            {
                source = File.ReadAllText(sourceFile);
            }
            else
            {
                Program.MessageBox(IntPtr.Zero, "The given source code file(" + sourceFile + " could not be found.", "Error!", 0);
                return;
            }

            window.Load += OnLoad;
            window.Run(1 / 60.0);

            window.Dispose();
            canvas.Dispose();
            runtime.Dispose();
        }