Пример #1
0
//        private float startX, startY, endX, endY, dimX, dimY;
        public MainWindow()
        {
            try
            {
                Dispatcher.BeginInvoke(DispatcherPriority.Loaded, new Action(() => { LoadUI(); }));
                InitializeComponent();

                DX11Display.Scene = Renderer.Singleton;
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }

            _mapper = new EmptyMapper();

            RedSea.Singleton.WPFWindow = this;
            FSMain.LoadData();
        }
Пример #2
0
        /// <summary>
        /// Attaches the host (the DPFcanvas in the window) to this to access its resources
        /// </summary>
        /// <param name="host"></param>
        public void Attach(ISceneHost host)
        {
            try
            {
                this._host = host;

                // Assure that a device is set.
                if (host.Device == null)
                {
                    throw new Exception("Scene host device is null");
                }

                SetupRenderer();
                FSMain.CreateRenderables();

                Initialized = true;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }