Пример #1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            for (int i = 0; i < e.Args.Length; i++)
            {
                if (e.Args[i].StartsWith("-") || e.Args[i].StartsWith("/"))
                {
                    if (e.Args.Length - 1 > i && !(e.Args[i + 1].StartsWith("-") || e.Args[i + 1].StartsWith("/")))
                    {
                        CommandArguments.SetArgument(e.Args[i].Substring(1), e.Args[i + 1]);
                    }
                    else
                    {
                        CommandArguments.SetArgument(e.Args[i].Substring(1));
                    }
                }
            }

            if (CommandArguments.TryGetArgument("ether"))
            {
                EtherManager.Initialize();
            }

            Editor editor = new     Editor();

            editor.Show();
        }
Пример #2
0
 private void Application_Exit(object sender, ExitEventArgs e)
 {
     if (CommandArguments.TryGetArgument("ether"))
     {
         EtherManager.Shutdown();
     }
 }
Пример #3
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (Template != null)
            {
                openGLControl   = Template.FindName("Viewport_3D", this) as OpenGLControl;
                hwndHostElement = Template.FindName("Ether_Viewport", this) as Control_Ether_HwndHost;
                sceneWindow     = Template.FindName("SceneWindow", this) as Grid;

                //TODO: Reference by name
                if (CommandArguments.TryGetArgument("ether"))
                {
                    sceneWindow.Children.RemoveAt(1);
                    return;
                }
                sceneWindow.Children.RemoveAt(2);


                CompositionTarget.Rendering += (sender, args) => openGLControl.DoRender();

                shaderErrorLabel = Template.FindName("Shader_Compiler_Error", this) as TextBlock;

                Hierarchy.FocusChangedEvent += o => cameraFocusPoint = o.Transform.Position;
            }
        }
Пример #4
0
        public SceneWindow()
        {
            InitializeComponent();


            if (CommandArguments.TryGetArgument("ether"))
            {
                SceneWindowContainer.Children.Remove(OpenGL_Viewport);
            }
            else
            {
                SceneWindowContainer.Children.Remove(Ether_Viewport);
                Renderer  = new OpenGLRenderer(OpenGL_Viewport);
                Unloaded += OnUnload;
                Loaded   += OnLoad;
            }
        }