Exemple #1
0
        // Public methods

        public override void Connect(bool connect)
        {
            base.Connect(connect);
            if (connect)
            {
                ConnectEventHandlers(true);
                ConnectCons(true);
                CommandCon.Clear();
                Clock.Tick += Clock_Tick;
                ClockStartup();
            }
            else
            {
                ClockShutdown();
                Clock.Tick -= Clock_Tick;
                RenderCon.InvalidateProgram();
                CommandCon.Clear();
                ConnectCons(false);
                ConnectEventHandlers(false);
                AppCon.Remove(this);
            }
        }
Exemple #2
0
        public void RecreateSceneControl()
        {
            GLControl
                oldControl = GetSceneControl(),
                newControl = new GLControl();
            var parent     = oldControl.Parent;

            newControl.BackColor = Scene.BackgroundColour;
            newControl.Dock      = DockStyle.Fill;
            newControl.Location  = new System.Drawing.Point(0, 0);
            newControl.Name      = "SceneControl";
            newControl.Size      = new System.Drawing.Size(100, 100);
            newControl.TabIndex  = 1;
            newControl.VSync     = Scene.VSync;
            parent.SuspendLayout();
            SceneCon.Connect(false);
            parent.Controls.Remove(oldControl);
            parent.Controls.Add(newControl);
            SceneCon.Connect(true);
            RenderCon.Refresh();
            parent.ResumeLayout();
            oldControl.Dispose();
        }
Exemple #3
0
 private void SceneControl_Paint(object sender, PaintEventArgs e) => RenderCon.Render();
Exemple #4
0
 private void Resize() => RenderCon.InvalidateProjection();
Exemple #5
0
 private void Clock_Tick(object sender, EventArgs e) => RenderCon.Render();