Example #1
0
    public static void Main(string[] args)
    {
        if (!Debugger.IsAttached)
        {
            AppDomain.CurrentDomain.UnhandledException += ReportUnhandledException;
        }

        var commandLineParser = new CommandLineApplication(false);
        var archiveOption     = commandLineParser.Option("--content", "content directory", CommandOptionType.SingleValue);

        commandLineParser.Execute(args);

        string contentPath;

        if (archiveOption.HasValue())
        {
            contentPath = archiveOption.Value();
        }
        else
        {
            contentPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "content");
        }

        var contentDir = new DirectoryInfo(contentPath);

        List <IArchiveDirectory> contentArchiveDirs = new List <IArchiveDirectory>();

        foreach (var archiveDir in contentDir.GetDirectories())
        {
            contentArchiveDirs.Add(UnpackedArchiveDirectory.Make(archiveDir));
        }
        foreach (var archiveFile in contentDir.GetFiles("*.archive"))
        {
            var archive = new PackedArchive(archiveFile);
            contentArchiveDirs.Add(archive.Root);
        }

        var unionedArchiveDir = UnionArchiveDirectory.Join("content", contentArchiveDirs);

        LeakTracking.Setup();

        string title = Application.ProductName + " " + Application.ProductVersion;

        try {
            using (VRApp app = new VRApp(unionedArchiveDir, title)) {
                app.Run();
            }
        } catch (VRInitException e) {
            string text = String.Join("\n\n",
                                      String.Format("OpenVR initialization failed: {0}", e.Message),
                                      "Please make sure SteamVR is installed and running, and VR headset is connected.");
            string caption = "OpenVR Initialization Error";

            MessageBox.Show(text, caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        LeakTracking.Finish();
    }
Example #2
0
    public static void Main(string[] args)
    {
        if (!Debugger.IsAttached)
        {
            AppDomain.CurrentDomain.UnhandledException += ReportUnhandledException;
        }

        var commandLineParser = new CommandLineApplication(false);
        var archiveOption     = commandLineParser.Option("--data", "path to archive file or directory", CommandOptionType.SingleValue);

        commandLineParser.Execute(args);

        string archivePath;

        if (archiveOption.HasValue())
        {
            archivePath = archiveOption.Value();
        }
        else
        {
            archivePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "data.archive");
        }

        IArchiveDirectory dataDir;

        var archiveAsDirectory = new DirectoryInfo(archivePath);

        if (archiveAsDirectory.Exists)
        {
            dataDir = UnpackedArchiveDirectory.Make(archiveAsDirectory);
        }
        else
        {
            var archive = new PackedArchive(new FileInfo(archivePath));
            dataDir = archive.Root;
        }

        LeakTracking.Setup();

        string title = Application.ProductName + " " + Application.ProductVersion;

        try {
            using (VRApp app = new VRApp(dataDir, title)) {
                app.Run();
            }
        } catch (VRInitException e) {
            string text = String.Join("\n\n",
                                      String.Format("OpenVR initialization failed: {0}", e.Message),
                                      "Please make sure SteamVR is installed and running, and VR headset is connected.");
            string caption = "OpenVR Initialization Error";

            MessageBox.Show(text, caption, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        LeakTracking.Finish();
    }
Example #3
0
        private void SetAppsMode(VRApp.Runtime runtime)
        {
            foreach (ListViewItem item in appsList.SelectedItems)
            {
                VRApp app = _itemApps[item];
                app.SelectedRuntime = runtime;
                UpdateViewFor(app);
            }

            Save();
        }
Example #4
0
        private void appsList_AfterLabelEdit(object sender, LabelEditEventArgs e)
        {
            VRApp  app     = _itemApps[appsList.Items[e.Item]];
            string newName = e.Label;

            if (newName == null)
            {
                return;
            }

            e.CancelEdit = true;
            app.Name     = newName == "" ? null : newName;
            UpdateViewFor(app);
            Save();
        }
Example #5
0
        private void UpdateViewFor(VRApp app)
        {
            ListViewItem item = _items[app];

            item.Text = app.Name;
            switch (app.SelectedRuntime)
            {
            case VRApp.Runtime.Default:
                item.Group = null;
                break;

            case VRApp.Runtime.OpenComposite:
                item.Group = _groupOpenComposite;
                break;

            case VRApp.Runtime.SteamVR:
                item.Group = _groupSteamVr;
                break;
            }
        }
Example #6
0
 public void Run()
 {
     ImporterMain.Main(new string[] {});
     VRApp.Main(new string[] { "--data=work" });
 }
Example #7
0
 public void Run()
 {
     VRApp.Main(new string[] { "--content=work\\content" });
 }
Example #8
0
 public void Run()
 {
     ImporterMain.Main(new string[] {});
     VRApp.Main(new string[] { "--content=work\\content" });
 }
Example #9
0
 public void Run()
 {
     VRApp.Main(new string[] { "--data=work" });
 }