Add launch flag to mutually exclusively enable XR/OpenVR

This commit is contained in:
Ada 2025-04-03 03:12:44 +10:00
parent 9cf3c748ca
commit d84b306e21
2 changed files with 17 additions and 0 deletions

View file

@ -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() {}

View file

@ -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;