Ejemplo n.º 1
0
        private void runForm_Click(object sender, EventArgs e)
        {
            if (animationRadio.Checked)
            {
                // Tasks 5.1 and 5.2

                AnimationForm form = new AnimationForm();
                form.Show();
            }
            else if (flyWithMeRadio.Checked)
            {
                // Tasks 5.3, 5.4 and 5.5
                FlyWithMeForm form = new FlyWithMeForm();
                form.Show();
            }
            else if (graphicsRadio.Checked)
            {
                // Tasks 6.1 to 6.6
                GraphicsForm form = new GraphicsForm();
                form.Show();
            }

            else if (bouncingBallRadio.Checked)
            {
                BouncingBallForm ballForm = new BouncingBallForm();
                ballForm.Show();
            }
        }
Ejemplo n.º 2
0
        private void runProgram(object sender, EventArgs e)
        {
            if (animationRadioButton.Checked)
            {
                // Tasks 5.1 and 5.2

                AnimationForm form = new AnimationForm();
                form.Show();
            }
            else if (flyMeRadioButton.Checked)
            {
                // Tasks 5.3, 5.4 and 5.5
                FlyMeForm form = new FlyMeForm();
                form.Show();
            }
            else if (unit6RadioButton.Checked)
            {
                // Tasks 6.1 to 6.6
                GraphicsForm form = new GraphicsForm();
                form.Show();
            }
            else if (bouncingBallRadio.Checked)
            {
                Bouncing_ball bouncing_Ball = new Bouncing_ball();
                bouncing_Ball.Show();
            }
            else if (unit7RadioButton.Checked)
            {
                SketchForm sketchForm = new SketchForm();
                sketchForm.Show();
            }
        }
Ejemplo n.º 3
0
 public void Run(Scene scene, SceneOptions options)
 {
     using (var form = new GraphicsForm(scene))
     {
         var view = new PictureBoxView(options);
         scene.Initialize(view);
         form.SetView(view);
         form.ShowDialog();
     }
 }
Ejemplo n.º 4
0
        // Public methods
        ///////////////////////

        public static Info New(Action <Context> onPaint)
        {
            var form = new GraphicsForm();

            form.Paint += (s, e) => onPaint(new Context(e.Graphics));
            var t = Thread.Run("graphics", () => Application.Run(form));

            return(new Info {
                form = form
            });
        }
Ejemplo n.º 5
0
        public Game(GraphicsForm graphics)
        {
            GraphicsForm.Rendering  += this.GameLoop;
            GraphicsForm.KeyPressed += this.KeyPressed;
            this.RenderEngine        = new Renderer(graphics);

            new Thread(() =>
            {
                Thread.CurrentThread.IsBackground = true;
                Connect("127.0.0.1");
            }).Start();
        }
Ejemplo n.º 6
0
        private void runProgram(object sender, EventArgs e)
        {
            if (animationRadioButton.Checked)
            {
                // Tasks 5.1 and 5.2

                AnimationForm form = new AnimationForm();
                form.Show();
            }
            else if (flyMeRadioButton.Checked)
            {
                // Tasks 5.3, 5.4 and 5.5
                FlyMeForm form = new FlyMeForm();
                form.Show();
            }
            else if (GraphicsRadioButton.Checked)
            {
                GraphicsForm form = new GraphicsForm();
                form.Show();
            }
        }
        /// <summary>
        /// Runs the main application loop.
        /// </summary>
        /// <param name="parameter">Tuple containing the object to pulse and the display bounds.</param>
        private void ApplicationRun(object parameter)
        {
            var parameters = (Tuple<object, Rectangle>)parameter;

            // Create the form.
            form = new GraphicsForm(!IsAlphaBlended);
            form.FormClosing += GraphicsForm_FormClosing;
            form.Disposed += GraphicsForm_Disposed;

            DisplayBounds = parameters.Item2;
            RemapKeyConflicts();

            // Hook up to form events.
            form.MouseDown += GraphicsForm_MouseDown;
            form.MouseClick += GraphicsForm_MouseClick;
            form.MouseUp += GraphicsForm_MouseUp;
            form.KeyPress += GraphicsForm_KeyPress;

            // Create manual painting handlers.
            manualRender = (sender, e) =>
            {
                if (IsAlphaBlended)
                    form.UpdateBackgroundGraphics();
                else
                    bufferedGraphics.Render(e.Graphics);
            };
            manualClear = (sender, e) => e.Graphics.Clear(form.TransparencyKey);

            postUpdateInvalidRegion.MakeEmpty();

            lock (parameters.Item1)
                Monitor.Pulse(parameters.Item1);
            Application.Run();
        }
        void CreateWindow(string applicationName, int windowWidth, int windowHeight, string windowIcon)
        {
            renderingWnd = new GraphicsForm(applicationName, windowWidth, windowHeight, windowIcon);

            renderingWnd.ClientResizeEvent += ResetDevice;
        }