Пример #1
0
        public void Startup()
        {
            Form = new Form();

            Form.Activated  += (sender, e) => Activated?.Invoke(sender, e);
            Form.Deactivate += (sender, e) => Deactivate?.Invoke(sender, e);
            Form.FormClosed += (sender, e) => Closed?.Invoke(sender, e);

            RenderControl = new GlControl();
            Form.SuspendLayout();
            //
            // RenderControl
            //
            RenderControl.Animation          = true;
            RenderControl.AnimationTimer     = false;
            RenderControl.BackColor          = System.Drawing.Color.DimGray;
            RenderControl.ColorBits          = 24u;
            RenderControl.DepthBits          = 0u;
            RenderControl.Dock               = DockStyle.Fill;
            RenderControl.Location           = new System.Drawing.Point(0, 0);
            RenderControl.MultisampleBits    = 0u;
            RenderControl.Name               = "RenderControl";
            RenderControl.Size               = new System.Drawing.Size(731, 428);
            RenderControl.StencilBits        = 0u;
            RenderControl.TabIndex           = 0;
            RenderControl.ContextCreated    += RenderControl_ContextCreated;
            RenderControl.ContextDestroying += (sender, e) => ContextDestroying?.Invoke(sender, e);
            RenderControl.Render            += (sender, e) => Render?.Invoke(sender, e);
            RenderControl.ContextUpdate     += (sender, e) => Update?.Invoke(sender, e);
            RenderControl.SizeChanged       += RenderControl_SizeChanged;

            Form.Controls.Add(RenderControl);
            Form.ResumeLayout(false);

            Form.Show();

            WorldMatrix = Matrix.OrthoRH(-1000.0f, 1000.0f, -1000.0f, 1000.0f, -1000.0f, 1000.0f);
            //WorldMatrix = Matrix.Translation(0, 0, 0);
        }
Пример #2
0
 /// <summary>
 /// Raise the event <see cref="ContextDestroying"/>.
 /// </summary>
 protected virtual void OnContextDestroying()
 {
     ContextDestroying?.Invoke(this, new SceneEditorAreaEventArgs(_graphicsContext, _renderContext));
 }
Пример #3
0
 /// <summary>
 /// Raise the event <see cref="ContextDestroying"/>.
 /// </summary>
 protected virtual void OnContextDestroying()
 {
     _IsContextCreated = false;
     ContextDestroying?.Invoke(this, new NativeWindowEventArgs(DeviceContext, GLContext));
 }