Exemplo n.º 1
0
 public D3DWFScene(FormsHost host, FrameworkElement overlay, ContextStateProcessor context, EngineNotificator notify)
 {
     this.host           = host;
     this.overlay        = overlay;
     host.HandleCreated += OnHandleCreated;
     host.Unloaded      += OnUnloaded;
     this.Context        = context;
     this.notify         = notify;
     loker = new object();
 }
Exemplo n.º 2
0
 public Scene(FormsHost host, FrameworkElement overlay, ContextStateProcessor context, EngineNotificator notify)
 {
     this.host           = host;
     this.overlay        = overlay;
     host.HandleCreated += OnHandleCreated;
     host.Unloaded      += OnUnloaded;
     this.Context        = context;
     this.notify         = notify;
     input = new CurrentInputObserver(Application.Current.MainWindow, new WPFInputPublisher(Application.Current.MainWindow));
 }
Exemplo n.º 3
0
        public void Init(FormsHost host, FrameworkElement overlay)
        {
            context = new ContextStateProcessor();
            context.AddState(0, x => new GenneralContextState(x, notificator));

            context.SwitchTo(0);

            scene = new SceneView(host, overlay, context, notificator);
            scene.RenderStarted += OnRenderStarted;

            primitiveDrawer.SetContext(context);

            VisualTreeviewer.RenderModeSwither = new RenderModeSwitherCommand(context);
        }
Exemplo n.º 4
0
        private void CreateForm()
        {
            Debug.WriteLine($"{_formType.Name} WinForm creation started on thread '{_currentThreadName}'");

            FormContext = new FormsHost(_formType, CloseCommand);
            WinForm     = FormContext.WinForm;

            if (!string.IsNullOrEmpty(WinForm.Text))
            {
                DisplayName = WinForm.Text;
            }

            WinForm.TextChanged += OnFormTextChanged;

            Debug.WriteLine($"{_formType.Name} WinForm created on thread '{_currentThreadName}'");
        }
Exemplo n.º 5
0
        public SceneView(FormsHost host, FrameworkElement overlay, ContextStateProcessor context, EngineNotificator notify)
            : base(host, overlay, context, notify)
        {
            //try {
            //    Fwk.ImageSharp.ImagePr.Load(Path.Combine(AppContext.BaseDirectory, "Textures", "spnza_bricks_a_diff.png"));
            //} catch (Exception ex) {
            //    ex.ToString();
            //}

            //var center = new Vector3();
            //var point = new Vector3(10, 10, 10);
            //var res = point + center;

            //var v = new Vector3(10, 10, 10) + new Vector3(5, 20, 0);
            //var v = new Vector3(5, 20, 0) - new Vector3(10, 10, 10);
            //var normal = v;
            //normal.Normalize();

            //var point1 = new Vector3(5, 20, 0) - normal * v.Length()/2;
            //var point2 = new Vector3(10, 10, 10) + normal * v.Length() / 2;
        }
Exemplo n.º 6
0
 public override void Release()
 {
     FormsHost.Dispose();
 }
Exemplo n.º 7
0
 public WFScene(FormsHost host, FrameworkElement overlay, ContextStateProcessor context, EngineNotificator notify)
     : base(host, overlay, context, notify)
 {
 }
Exemplo n.º 8
0
 public D3DWFScene(FormsHost host, FrameworkElement overlay, ContextStateProcessor context) :
     this(host, overlay, context, new EngineNotificator())
 {
 }
Exemplo n.º 9
0
 public void SetSurfaceHost(FormsHost host, FrameworkElement overlay)
 {
     this.host           = host;
     this.overlay        = overlay;
     host.HandleCreated += SurfaceCreated;
 }