From d84b306e21bf04b13d6d791880c838ef15f2f047 Mon Sep 17 00:00:00 2001 From: Ada Date: Thu, 3 Apr 2025 03:12:44 +1000 Subject: [PATCH] Add launch flag to mutually exclusively enable XR/OpenVR --- interface/src/Application_Plugins.cpp | 12 ++++++++++++ interface/src/main.cpp | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/interface/src/Application_Plugins.cpp b/interface/src/Application_Plugins.cpp index 77786da424..6c41ae2e59 100644 --- a/interface/src/Application_Plugins.cpp +++ b/interface/src/Application_Plugins.cpp @@ -73,6 +73,18 @@ void Application::initializePluginManager(const QCommandLineParser& parser) { qInfo() << "Disabling following input plugins:" << disabledInputs; PluginManager::getInstance()->disableInputs(disabledInputs); } + + if (parser.isSet("useExperimentalXR")) { + auto pluginNames = QStringList(); + pluginNames.push_back("OpenVR (Vive)"); + PluginManager::getInstance()->disableDisplays(pluginNames); + PluginManager::getInstance()->disableInputs(pluginNames); + } else { + auto pluginNames = QStringList(); + pluginNames.push_back("OpenXR"); + PluginManager::getInstance()->disableDisplays(pluginNames); + PluginManager::getInstance()->disableInputs(pluginNames); + } } void Application::shutdownPlugins() {} diff --git a/interface/src/main.cpp b/interface/src/main.cpp index a3141ccb95..d67a1d0c82 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -286,6 +286,10 @@ int main(int argc, const char* argv[]) { "getProtocolVersionData", "Debug option. Returns the network protocol detailed data in JSON." ); + QCommandLineOption useExperimentalXR( + "useExperimentalXR", + "Enables the experimental OpenXR plugin and disables the OpenVR plugin. Some features available in OpenVR aren't yet available in OpenXR." + ); // "--qmljsdebugger", which appears in output from "--help-all". // Those below don't seem to be optional. @@ -335,6 +339,7 @@ int main(int argc, const char* argv[]) { parser.addOption(getPluginsOption); parser.addOption(getProtocolVersionHashOption); parser.addOption(getProtocolVersionDataOption); + parser.addOption(useExperimentalXR); QString applicationPath;