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(); }
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)); }
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); }
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}'"); }
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; }
public override void Release() { FormsHost.Dispose(); }
public WFScene(FormsHost host, FrameworkElement overlay, ContextStateProcessor context, EngineNotificator notify) : base(host, overlay, context, notify) { }
public D3DWFScene(FormsHost host, FrameworkElement overlay, ContextStateProcessor context) : this(host, overlay, context, new EngineNotificator()) { }
public void SetSurfaceHost(FormsHost host, FrameworkElement overlay) { this.host = host; this.overlay = overlay; host.HandleCreated += SurfaceCreated; }